Semantic analysis of ambiguous types in dynamic languages

  • Jakub Misek
  • Filip Zavoral
Original Research


The recent expansion of cloud-based solutions highlights that legacy programming languages and technologies, such as the PHP language, are still in heavy use. Furthermore, it turns out that for their effective integration into modern platforms, it is important to understand the legacy code base to provide modern analysis, testing and eventually compiler tooling. The dynamic language PHP would be the perfect candidate for such a synergy, due to its extensive usage, frequent issues in source codes and the need for a better performance and scalability. In this paper, we describe a solution that combines known static language code analysis techniques, and that is enhanced by numerous modifications. As a result, we have a design and implementation of a PHP dynamic language code analysis, compiler and runtime, which improves performance and allows for more advanced high-level code analysis and tools, all incorporated into the modern platform of .NET Core while taking advantage of the Microsoft Roslyn Compiler Platform.


Php Compilers Dynamic languages Type analysis 



This work was supported by Charles University Grant Agency (GAUK) project 1156216, project PROGRES Q48, and by Specific Research project SVV-2017-260451.


  1. Bacon DF, Sweeney PF (1996) Fast static analysis of C + + virtual function calls. ACM Sigplan Not 31.10:324–341CrossRefGoogle Scholar
  2. Benda J, Matousek T, Prosek L (2006) Phalanger: Compiling and running PHP applications on the Microsoft .NET platform. .NET Technologies 2006, UNION Agency – Science Press, Plzen, Czech RepublicGoogle Scholar
  3. Cassales GW, Charão, AS, Kirsch-Pinheiro M, Souveyet C, Steffenel LA (2016) Improving the performance of Apache Hadoop on pervasive environments through context-aware scheduling. J Ambient Intell Humanized Comput 7(3):333–345CrossRefGoogle Scholar
  4. Consel C, Hornof L, Noël F, Noyé J, Volanschi EN (1996) A uniform approach for compile-time and run-time specialization. Partial evaluation. Springer, Berlin Heidelberg pp 54–72 (LNCS 1110)Google Scholar
  5. Darwish A, Hassanien AE, Elhoseny M, Sangaiah AK, Muhammad K (2017) The impact of the hybrid platform of internet of things and cloud computing on healthcare systems: opportunities, challenges, and open problems. J Ambient Intell Humaniz Comput. Google Scholar
  6. Del Sole A (2016) Roslyn Succintly, Syncfusion 2016Google Scholar
  7. Detlefs D, Agesen O (1999) Inlining of virtual methods. In: ECOOP 1999 pp 258–278Google Scholar
  8. Hauzar D, Kofron J (2015) Framework for static analysis of PHP applications. LIPIcs-Leibniz International Proceedings in Informatics. Vol 37Google Scholar
  9. Ishizaki K, Kawahito M, Yasue T, Takeuchi M, Ogasawara T, Suganuma T, Onodera T, Komatsu H, Nakatani T (1999) Design, implementation, and evaluation of optimizations in a just-in-time compiler. In: Proceedings of the ACM 1999 conference on Java Grande. ACMGoogle Scholar
  10. Jensen SH, Moller A, Thiemann P (2009) Type analysis for JavaScript. International Static Analysis Symposium. Springer, Berlin Heidelberg, pp 238–255Google Scholar
  11. Jones ND, Gomard CK, Sestoft P (1993) Partial evaluation and automatic program generation. Prentice Hall, Upper Saddle RiverzbMATHGoogle Scholar
  12. Misek J, Fistein B (2017), Accessed 15 Sept 2017
  13. Misek J, Fistein B, Zavoral F (2016) Inferring common language infrastructure metadata for an ambiguous dynamic language type. IEEE Conference on Open Systems, LangkawiGoogle Scholar
  14. Ng K, Warren M, Golde P, Hejlberg A (2011) The Roslyn Project, exposing the C# and VB compiler’s code analysis. Microsoft, 2011Google Scholar
  15. Nielson F, Nielson HR, Hankin C (2015) Principles of program analysis. SpringerzbMATHGoogle Scholar
  16. PHP (2017) Accessed 15 Sept 2017
  17. Stogov D (2014) PHPNG a New Core for PHP7, ZendConfGoogle Scholar
  18. Viega J, Bloch JT, Kohno T, McGraw G (2000) ITS4: A static vulnerability scanner for C and C++ code. Computer Security Applications, ACSAC’00. In: 16th Annual Conference. IEEE pp 257–267Google Scholar
  19. WordPress (2017) Accessed 15 Sept 2017

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Department of Software EngineeringCharles UniversityPragueCzech Republic

Personalised recommendations