3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculValeurEcoGes($valeur, $type = 1) { $intervalles = array( // Indice 1= Eco, Indice 2=GES 1 => array ('A' => array(0, 50), 'B' => array(51, 90), 'C' => array(91, 150), 'D' => array(151, 230), 'E' => array(231, 330), 'F' => array(331, 450), G => array(451, 99999)), 2 => array('A' => array(0, 5), 'B' => array(6, 10), 'C' => array(11, 20), 'D' => array(21, 35), 'E' => array(36, 55), 'F' => array(56, 80), 'G' => array(81, 99999)) ); if($type < 1 || $type > 2) { exit("Erreur, le type de valeur éco. doit être compris entre 1 et 2"); } $intervalle = $intervalles($type); foreach($intervalle as $lettre => $minMax) { lit($min, $max) = $minMax; if($valeur >= $min && $valeur <= $max) { return $lettre; } } return 'Z'; } echo calculValeurEcoGes(40, 1);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.60.0230.05016.33
5.4.50.0230.03316.43
5.4.40.0330.04716.43
5.4.30.0200.05016.42
5.4.20.0230.07016.17
5.4.10.0370.06016.51
5.4.00.0270.04715.94
5.3.160.0330.06714.46
5.3.150.0270.07314.69
5.3.140.0270.07314.54
5.3.130.0270.06714.64
5.3.120.0300.06314.79
5.3.110.0270.07314.79
5.3.100.0270.03313.95
5.3.90.0230.04014.00
5.3.80.0200.05314.08
5.3.70.0270.07314.11
5.3.60.0230.07013.93
5.3.50.0330.06314.01
5.3.40.0370.04314.12
5.3.30.0270.06713.83
5.3.20.0230.04713.68
5.3.10.0200.06013.58
5.3.00.0270.04713.63