3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define("Hi", "Hello"); echo Hi; $cars = array("car1"=>"BMW", "car2"=>"Ferrai", "car3"=>"Audi"); echo $cars[car1]; foreach($cars as $x=>$value) { echo "$x $value <br>"; } function add($x = 10 , $y = 15) { $z = $x+$y; return $z; } echo "4 + 3".add(4,3); echo add(); ?>
based on PGH3B
Output for 7.2.0
Hello Warning: Use of undefined constant car1 - assumed 'car1' (this will throw an Error in a future version of PHP) in /in/WZ7jC on line 6 BMWcar1 BMW <br>car2 Ferrai <br>car3 Audi <br>4 + 3725
Output for 5.3.19 - 7.1.10
Hello Notice: Use of undefined constant car1 - assumed 'car1' in /in/WZ7jC on line 6 BMWcar1 BMW <br>car2 Ferrai <br>car3 Audi <br>4 + 3725