3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class X { function __descruct() { echo "I'm done!"; } } function make_x() { new X(); } for ($i = 0; $i < 10; $i++) { echo "Making X $i\n"; make_x(); }
Output for 4.3.0 - 7.2.0
Making X 0 Making X 1 Making X 2 Making X 3 Making X 4 Making X 5 Making X 6 Making X 7 Making X 8 Making X 9