3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Carro { protected $productos = array (); public function add ( $producto, $cantidad ) { this->productos[$producto] = $cantidad; } public function what_inside_cart () { $callback = function ( $producto ) { return $producto; } array_walk ( $this->productos, $callback ); } } $mi_carro = new Carro; // Añadir algunos artículos al carro $mi_carro->añadir('mantequilla', 1); $mi_carro->añadir('leche', 3); $mi_carro->añadir('huevos', 6); echo $mi_carro->what_inside_cart ();

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.230.0150.05512.38
5.4.220.0110.03712.38
5.4.210.0110.04512.38
5.4.200.0110.04712.39
5.4.190.0130.04512.38
5.4.180.0110.04312.38
5.4.170.0080.04412.39
5.4.160.0220.05812.38
5.4.150.0080.04112.38
5.4.140.0080.04312.07
5.4.130.0070.04012.05
5.4.120.0080.04112.02
5.4.110.0090.04012.01
5.4.100.0070.04012.01
5.4.90.0100.04112.01
5.4.80.0130.05712.01
5.4.70.0080.04112.01
5.4.60.0100.03612.01
5.4.50.0080.03912.01
5.4.40.0080.03812.00
5.4.30.0120.04311.99
5.4.20.0070.04511.99
5.4.10.0110.04011.99
5.4.00.0130.05011.49
5.3.280.0110.04512.71
5.3.270.0100.04612.72
5.3.260.0120.04512.72
5.3.250.0120.04312.72
5.3.240.0100.04512.72
5.3.230.0110.04512.71
5.3.220.0120.04312.68
5.3.210.0090.04712.68
5.3.200.0110.04512.68
5.3.190.0100.04912.67
5.3.180.0100.04412.67
5.3.170.0220.05412.67
5.3.160.0110.04612.67
5.3.150.0120.04512.67
5.3.140.0090.04012.66
5.3.130.0110.03912.66
5.3.120.0120.04912.66
5.3.110.0100.04112.66
5.3.100.0100.04012.12
5.3.90.0090.04112.09
5.3.80.0100.04112.08
5.3.70.0120.03812.08
5.3.60.0090.04112.07
5.3.50.0110.03812.01
5.3.40.0100.04112.01
5.3.30.0150.05211.97
5.3.20.0080.03911.74
5.3.10.0090.03811.71
5.3.00.0080.04111.69

preferences:
135.1 ms | 1394 KiB | 7 Q