3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function smallest($first, $second, $third) { foreach(func_get_args() as $a_parameter) { if($a_paremeter==intval($a_parameter)) // only if parameter is a number { if(!isset($maximum)) // for the first time paremeter is maximum { $maximum= $a_parameter; } if($a_parameter<$minimum) // for each parameter we check if its lower and set minimum { $minimum=$a_parameter; } } } return $minimum; } function largest($first, $second, $third) { foreach(func_get_args() as $a_parameter) { if($a_paremeter==intval($a_parameter)) // only if parameter is a number { if(!isset($maximum)) // for the first time paremeter is maximum { $maximum= $a_parameter; } if($a_parameter>$maximum) // for each parameter we check if its greater and set maximum { $maximum=$a_parameter; } } } return $maximum; } echo smallest(-1,23,900); echo largest(3,5,1000); ?>
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: a_paremeter in /in/Yoams on line 8 Notice: Undefined variable: a_paremeter in /in/Yoams on line 8 Notice: Undefined variable: a_paremeter in /in/Yoams on line 8 Notice: Undefined variable: minimum in /in/Yoams on line 23 Notice: Undefined variable: a_paremeter in /in/Yoams on line 32 Notice: Undefined variable: a_paremeter in /in/Yoams on line 32 Notice: Undefined variable: a_paremeter in /in/Yoams on line 32 Notice: Undefined variable: maximum in /in/Yoams on line 45
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: a_paremeter in /in/Yoams on line 8 Notice: Undefined variable: a_paremeter in /in/Yoams on line 8 Notice: Undefined variable: a_paremeter in /in/Yoams on line 8 Notice: Undefined variable: minimum in /in/Yoams on line 23 Notice: Undefined variable: a_paremeter in /in/Yoams on line 32 Notice: Undefined variable: a_paremeter in /in/Yoams on line 32 Notice: Undefined variable: a_paremeter in /in/Yoams on line 32 Notice: Undefined variable: maximum in /in/Yoams on line 45