3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function solve($a0 = 5, $a1 = 6, $a2 = 7, $b0 = 4, $b1 = 5, $b2 = 7) { $pointsArray = array(); $varA = ""; $varA = 'a1'; echo $$varA; for($i = 0; $i++; $i < 3) { $varA = "a{$i}"; echo $varA; $varB = "b{$i}"; echo ${$varA}; if(${$varA} > ${$varB}) { $pointsArray['A'] = 1; } elseif (${$varA} < ${$varB}) { $pointsArray ['B'] = 1; } } echo $pointsArray['A'] . " " . $pointsArray['B']; } solve();
based on AaqJv
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3, 7.0.0 - 7.3.0beta1
6 Notice: Undefined index: A in /in/lK8LY on line 56 Notice: Undefined index: B in /in/lK8LY on line 56
Output for hhvm-3.22.0
6 Notice: Undefined index: A in /in/lK8LY on line -1 Notice: Undefined index: B in /in/lK8LY on line -1