3v4l.org

run code in 300+ PHP versions simultaneously
<?php $juices = array("apple", "orange", "koolaid1" => "purple"); echo "He drank some $juices[0] juice.".PHP_EOL; echo "He drank some $juices[1] juice.".PHP_EOL; echo "He drank some juice made of $juice[0]s.".PHP_EOL; // Не будет работать echo "He drank some $juices[koolaid1] juice.".PHP_EOL; class people { public $john = "John Smith"; public $jane = "Jane Smith"; public $robert = "Robert Paulsen"; public $smith = "Smith"; } $people = new people(); echo "$people->john drank some $juices[0] juice.".PHP_EOL; echo "$people->john then said hello to $people->jane.".PHP_EOL; echo "$people->john's wife greeted $people->robert.".PHP_EOL; echo "$people->robert greeted the two $people->smiths."; // Не будет работать ?>
Output for git.master, git.master_jit
He drank some apple juice. He drank some orange juice. Warning: Undefined variable $juice in /in/llA87 on line 6 Warning: Trying to access array offset on value of type null in /in/llA87 on line 6 He drank some juice made of s. He drank some purple juice. John Smith drank some apple juice. John Smith then said hello to Jane Smith. John Smith's wife greeted Robert Paulsen. Warning: Undefined property: people::$smiths in /in/llA87 on line 22 Robert Paulsen greeted the two .
Output for rfc.property-hooks
He drank some apple juice. He drank some orange juice. Warning: Undefined variable $juice in /in/llA87 on line 6 Warning: Trying to access array offset on null in /in/llA87 on line 6 He drank some juice made of s. He drank some purple juice. John Smith drank some apple juice. John Smith then said hello to Jane Smith. John Smith's wife greeted Robert Paulsen. Warning: Undefined property: people::$smiths in /in/llA87 on line 22 Robert Paulsen greeted the two .

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.56 ms | 402 KiB | 8 Q