3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_map_custom($array, $callable) { $result = []; foreach($array as $item) { $result[] = $callable($item); } return $result; } $arr = [1, 2, 3, 4]; $newArr = array_map_custom( $arr, function($x){ return $x*$x; }); print_r($newArr);

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)
8.4.120.0050.00317.93
8.4.110.0140.00717.99
8.4.100.0130.00717.89
8.4.90.0130.00720.29
8.4.80.0090.00718.97
8.4.70.0050.00420.77
8.4.60.0050.00322.34
8.4.50.0090.00717.85
8.4.40.0070.01118.54
8.4.30.0180.00418.68
8.4.20.0150.00419.65
8.4.10.0030.00619.67
8.3.250.0070.00116.95
8.3.240.0140.00716.41
8.3.230.0110.00816.62
8.3.220.0100.00819.12
8.3.210.0110.00816.70
8.3.200.0060.00316.57
8.3.190.0130.00618.35
8.3.180.0120.00716.86
8.3.170.0070.00318.88
8.3.160.0150.00317.37
8.3.150.0180.00317.21
8.3.140.0110.00720.70
8.3.130.0040.00418.48
8.3.120.0030.00618.91
8.3.110.0040.00420.94
8.3.100.0110.00024.06
8.3.90.0110.00726.77
8.3.80.0080.00317.97
8.3.70.0060.01616.46
8.3.60.0110.00416.48
8.3.50.0100.00718.25
8.3.40.0250.00021.64
8.3.30.0190.00321.01
8.3.20.0070.01423.61
8.3.10.0120.00923.55
8.3.00.0160.00620.85
8.2.290.0050.00416.78
8.2.280.0090.01118.42
8.2.270.0070.01118.93
8.2.260.0150.00316.86
8.2.250.0040.01216.57
8.2.240.0070.00720.73
8.2.230.0040.00422.58
8.2.220.0090.00637.54
8.2.210.0080.00026.77
8.2.200.0090.00016.75
8.2.190.0120.00916.75
8.2.180.0120.00916.49
8.2.170.0130.00920.84
8.2.160.0100.01021.75
8.2.150.0150.00621.07
8.2.140.0170.00322.23
8.2.130.0070.01322.08
8.2.120.0150.00321.03
8.2.110.0030.01721.13
8.2.100.0130.00620.95
8.2.90.0140.00720.42
8.2.80.0140.00721.10
8.2.70.0180.00420.55
8.2.60.0140.00720.62
8.2.50.0160.00621.11
8.2.40.0150.00620.37
8.2.30.0070.01420.49
8.2.20.0210.00020.55
8.2.10.0070.01720.46
8.2.00.0170.01020.59
8.1.330.0080.01015.92
8.1.320.0090.01117.85
8.1.310.0070.00716.64
8.1.300.0050.00517.63
8.1.290.0070.00330.84
8.1.280.0090.00625.92
8.1.270.0160.00624.02
8.1.260.0090.01223.90
8.1.250.0070.01323.91
8.1.240.0200.00720.26
8.1.230.0170.01020.45
8.1.220.0180.00420.58
8.1.210.0120.00920.16
8.1.200.0140.00720.59
8.1.190.0180.00320.46
8.1.180.0140.00720.26
8.1.170.0210.00020.65
8.1.160.0040.01820.34
8.1.150.0210.00020.66
8.1.140.0040.01820.47
8.1.130.0070.01420.49
8.1.120.0120.00920.35
8.1.110.0120.00920.41
8.1.100.0180.00421.59
8.1.90.0100.01020.28
8.1.80.0100.01021.51
8.1.70.0100.00720.62
8.1.60.0040.01820.40
8.1.50.0150.00320.34
8.1.40.0040.01820.40
8.1.30.0150.00320.78
8.1.20.0120.00921.89
8.1.10.0140.00720.53
8.1.00.0090.01220.30

preferences:
54.83 ms | 403 KiB | 5 Q