3v4l.org

run code in 300+ PHP versions simultaneously
<?php class asset { protected $id; function __construct($id) { $this->id = $id; } function getId() { return $this->id; } } $getIdsCode = 'array_walk($input, array(asset, "getId"))'; // UPDATE THIS if (strpos($getIdsCode, ';') !== false) die('code should not contain ; !'); $getIdsCode = preg_replace('/\s+/', '', $getIdsCode); echo 'code length '.strlen($getIdsCode)."\n"; $input = array(new asset(10),new asset(20),new asset(30)); echo eval("return $getIdsCode;") . "\n"; $input = array(new asset(40),new asset(50),new asset(60)); echo eval("return $getIdsCode;") . "\n"; ?>

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.3.60.0040.01116.61
8.3.50.0180.00322.99
8.3.40.0210.00019.23
8.3.30.0090.00619.17
8.3.20.0070.00020.07
8.3.10.0050.00323.65
8.3.00.0030.00519.63
8.2.180.0120.00618.53
8.2.170.0070.00722.96
8.2.160.0110.00420.35
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0110.00426.16
8.2.120.0040.00421.01
8.2.110.0000.00919.08
8.2.100.0070.00417.92
8.2.90.0040.00419.17
8.2.80.0030.00617.97
8.2.70.0000.00917.75
8.2.60.0000.00717.80
8.2.50.0050.00518.07
8.2.40.0030.00519.84
8.2.30.0100.00019.87
8.2.20.0050.00317.91
8.2.10.0040.00418.07
8.2.00.0070.00018.05
8.1.280.0130.01025.92
8.1.270.0080.00023.85
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00621.12
8.1.230.0080.00417.51
8.1.220.0030.00517.79
8.1.210.0000.00818.77
8.1.200.0060.00317.60
8.1.190.0060.00317.47
8.1.180.0030.00518.10
8.1.170.0000.00818.70
8.1.160.0000.00721.97
8.1.150.0090.00018.92
8.1.140.0030.00917.66
8.1.130.0030.00317.93
8.1.120.0000.00717.47
8.1.110.0050.00317.52
8.1.100.0040.00417.54
8.1.90.0050.00217.51
8.1.80.0000.00717.67
8.1.70.0000.00817.61
8.1.60.0040.00417.73
8.1.50.0030.00617.71
8.1.40.0000.00817.71
8.1.30.0030.00617.80
8.1.20.0050.00317.77
8.1.10.0060.00317.76
8.1.00.0000.00717.66
8.0.300.0000.00718.77
8.0.290.0040.00416.84
8.0.280.0100.00018.37
8.0.270.0070.00017.18
8.0.260.0000.00617.30
8.0.250.0030.00317.13
8.0.240.0000.00817.17
8.0.230.0070.00017.18
8.0.220.0000.00717.13
8.0.210.0000.00717.14
8.0.200.0030.00317.22
8.0.190.0030.00517.16
8.0.180.0070.00317.13
8.0.170.0000.00817.01
8.0.160.0040.00417.10
8.0.150.0050.00217.04
8.0.140.0000.00716.89
8.0.130.0040.00413.59
8.0.120.0030.00517.10
8.0.110.0050.00217.11
8.0.100.0040.00417.07
8.0.90.0000.00717.06
8.0.80.0090.01317.10
8.0.70.0050.00317.02
8.0.60.0090.00016.98
8.0.50.0040.00416.97
8.0.30.0130.00617.41
8.0.20.0080.01117.48
8.0.10.0040.00417.29
8.0.00.0120.00616.98
7.4.330.0030.00315.00
7.4.320.0000.00716.77
7.4.300.0060.00016.74
7.4.290.0000.00816.73
7.4.280.0030.00516.64
7.4.270.0030.00316.77
7.4.260.0050.00216.87
7.4.250.0050.00316.83
7.4.240.0020.00716.82
7.4.230.0040.00416.84
7.4.220.0110.00716.93
7.4.210.0100.00316.80
7.4.200.0040.00416.84
7.4.160.0100.01016.57
7.4.150.0150.00317.40
7.4.140.0070.00917.86
7.4.130.0050.01316.74
7.4.120.0120.00616.71
7.4.110.0140.01016.73
7.4.100.0110.01016.63
7.4.90.0180.00716.88
7.4.80.0000.01819.39
7.4.70.0040.01516.76
7.4.60.0030.01416.78
7.4.50.0050.00016.61
7.4.40.0090.00916.75
7.4.30.0090.00916.74
7.4.00.0080.00915.32
7.3.330.0040.00413.57
7.3.320.0060.00013.34
7.3.310.0030.00316.64
7.3.300.0030.00316.52
7.3.290.0120.00416.60
7.3.280.0090.00916.59
7.3.270.0090.01217.40
7.3.260.0030.02016.59
7.3.250.0080.00816.74
7.3.240.0030.01416.67
7.3.230.0120.00616.77
7.3.210.0160.00816.61
7.3.200.0040.01219.39
7.3.190.0140.00416.49
7.3.180.0090.00616.74
7.3.170.0060.01016.56
7.3.160.0080.00816.52
7.3.120.0170.00015.18
7.3.110.0070.01015.31
7.3.100.0060.00915.03
7.3.90.0060.00915.09
7.3.80.0080.00814.82
7.3.70.0060.00615.06
7.3.60.0000.01014.86
7.3.50.0030.01315.14
7.3.40.0070.00315.14
7.3.30.0070.01015.00
7.3.20.0060.00616.98
7.3.10.0090.00316.66
7.3.00.0000.01416.86
7.2.330.0090.00916.75
7.2.320.0100.00717.05
7.2.310.0090.01216.97
7.2.300.0060.01016.87
7.2.290.0060.01516.94
7.2.250.0100.00615.16
7.2.240.0080.00415.19
7.2.230.0090.00615.13
7.2.220.0100.00315.39
7.2.210.0080.00815.32
7.2.200.0100.00315.20
7.2.190.0070.00714.93
7.2.180.0040.00815.27
7.2.170.0090.00615.17
7.2.60.0060.00917.24
7.2.00.0030.01219.77
7.1.330.0110.00415.98
7.1.320.0090.00616.08
7.1.310.0030.00615.70
7.1.300.0100.00316.05
7.1.290.0110.00416.22
7.1.280.0090.00615.77
7.1.270.0040.00816.00
7.1.260.0040.00816.13
7.1.200.0070.00315.96
7.1.100.0070.00718.18
7.1.70.0030.00917.13
7.1.60.0030.02119.46
7.1.50.0070.01017.34
7.1.00.0030.07722.45
7.0.200.0050.00317.04
7.0.140.0000.07322.09
7.0.110.0230.03319.88
7.0.100.0070.07721.72
7.0.90.0030.06321.73
7.0.80.0070.03721.76
7.0.70.0030.04321.72
7.0.60.0070.03721.64
7.0.50.0030.04321.79
7.0.40.0100.03019.66
7.0.30.0030.04719.79
7.0.20.0070.04319.73
7.0.10.0000.04319.77
7.0.00.0000.04319.81
5.6.280.0130.06320.86
5.6.260.0000.03720.66
5.6.250.0130.07320.75
5.6.240.0130.06320.73
5.6.230.0030.05320.70
5.6.220.0070.03720.66
5.6.210.0130.03020.55
5.6.200.0100.03720.63
5.6.190.0030.05320.65
5.6.180.0030.03320.63
5.6.170.0030.04320.62
5.6.160.0070.03720.56
5.6.150.0030.04020.62
5.6.140.0030.04320.62
5.6.130.0000.04720.57
5.6.120.0030.04020.63
5.6.110.0000.04020.61
5.6.100.0030.03720.57
5.6.90.0070.03020.54
5.6.80.0070.03319.93
5.6.70.0070.03720.01
5.6.60.0100.06719.98
5.6.50.0070.06019.97
5.6.40.0070.07720.21
5.6.30.0070.08020.01
5.6.20.0070.07320.05
5.6.10.0000.08019.95
5.6.00.0000.05019.91
5.5.380.0070.06017.54
5.5.370.0070.03317.69
5.5.360.0000.03717.69
5.5.350.0000.07317.63
5.5.340.0000.04318.23
5.5.330.0070.04018.23
5.5.320.0000.07017.96
5.5.310.0100.03718.14
5.5.300.0100.03317.94
5.5.290.0070.03718.23
5.5.280.0000.04318.25
5.5.270.0030.03318.09
5.5.260.0000.03718.13
5.5.250.0000.05017.74
5.5.240.0000.04017.66
5.5.230.0070.06317.50
5.5.220.0100.06017.46
5.5.210.0030.05717.29
5.5.200.0070.06717.43
5.5.190.0000.07317.28
5.5.180.0070.03317.40
5.5.160.0000.04017.58
5.5.150.0070.05017.28
5.5.140.0000.07017.19
5.5.130.0070.05317.30
5.5.120.0030.07717.42
5.5.110.0000.08017.46
5.5.100.0030.08017.36
5.5.90.0030.08317.16
5.5.80.0100.07717.46
5.5.70.0130.07317.47
5.5.60.0070.06317.36
5.5.50.0000.08017.18
5.5.40.0070.05017.17
5.5.30.0030.07317.33
5.5.20.0100.06717.49
5.5.10.0030.08017.17
5.5.00.0070.06717.08
5.4.450.0000.04319.66
5.4.440.0070.04719.66
5.4.430.0000.04019.55
5.4.420.0000.04019.66
5.4.410.0100.03019.15
5.4.400.0070.03019.34
5.4.390.0000.04719.31
5.4.380.0070.08319.13
5.4.370.0070.07719.02
5.4.360.0130.07019.31
5.4.350.0030.07718.95
5.4.340.0030.07018.95
5.4.320.0030.07019.09
5.4.310.0030.03019.13
5.4.300.0100.07319.18
5.4.290.0070.08019.22
5.4.280.0030.07318.98
5.4.270.0030.06719.23
5.4.260.0070.07319.05
5.4.250.0000.05718.99
5.4.240.0000.07719.13
5.4.230.0130.07019.22
5.4.220.0100.07319.01
5.4.210.0100.07719.22
5.4.200.0100.07318.99
5.4.190.0070.07719.02
5.4.180.0070.07019.21
5.4.170.0130.06319.02
5.4.160.0170.06719.01
5.4.150.0100.07719.21
5.4.140.0070.04716.59
5.4.130.0070.05716.54
5.4.120.0000.07016.50
5.4.110.0000.08316.49
5.4.100.0100.07016.59
5.4.90.0100.05016.49
5.4.80.0030.04316.63
5.4.70.0070.06716.55
5.4.60.0000.04016.55
5.4.50.0100.06016.44
5.4.40.0100.07016.33
5.4.30.0070.07016.46
5.4.20.0130.06316.53
5.4.10.0070.07016.33
5.4.00.0070.07315.91
5.3.290.0000.03314.66
5.3.280.0030.05014.46
5.3.270.0030.05714.71
5.3.260.0000.08314.59
5.3.250.0030.07314.75
5.3.240.0100.06714.47
5.3.230.0100.07014.57
5.3.220.0070.06714.65
5.3.210.0070.07314.63
5.3.200.0030.05314.66
5.3.190.0030.08014.55
5.3.180.0030.07314.71
5.3.170.0030.04314.65
5.3.160.0070.05714.55
5.3.150.0130.07014.54
5.3.140.0000.05314.58
5.3.130.0030.07714.55
5.3.120.0000.07014.58
5.3.110.0100.06714.55
5.3.100.0100.04714.06
5.3.90.0100.06714.05
5.3.80.0070.07014.10
5.3.70.0030.06314.09
5.3.60.0000.08014.11
5.3.50.0070.07313.96
5.3.40.0100.04713.96
5.3.30.0000.07313.88
5.3.20.0000.05313.69
5.3.10.0030.05713.89
5.3.00.0070.06313.63
5.2.170.0070.05711.16
5.2.160.0100.05011.14
5.2.150.0000.03711.02
5.2.140.0000.03011.16
5.2.130.0070.02311.27
5.2.120.0030.03311.08
5.2.110.0000.04711.12
5.2.100.0030.03011.13
5.2.90.0000.03010.98
5.2.80.0030.03011.09
5.2.70.0030.03311.24
5.2.60.0030.04711.29
5.2.50.0070.05711.05
5.2.40.0030.05711.12
5.2.30.0030.06010.97
5.2.20.0030.03011.05
5.2.10.0000.06011.01
5.2.00.0000.04710.75
5.1.60.0030.02710.26
5.1.50.0070.04710.01
5.1.40.0000.05010.08
5.1.30.0030.04710.43
5.1.20.0070.05310.39
5.1.10.0000.05310.04
5.1.00.0030.05010.24
5.0.50.0000.0309.72
5.0.40.0000.0439.72
5.0.30.0030.0639.72
5.0.20.0000.0439.72
5.0.10.0030.0409.72
5.0.00.0030.0639.72
4.4.90.0000.0279.72
4.4.80.0000.0209.72
4.4.70.0030.0339.72
4.4.60.0000.0379.72
4.4.50.0030.0279.72
4.4.40.0000.0539.72
4.4.30.0000.0279.72
4.4.20.0000.0279.72
4.4.10.0000.0339.72
4.4.00.0000.0209.72
4.3.110.0030.0309.72
4.3.100.0000.0339.72
4.3.90.0000.0279.72
4.3.80.0000.0479.72
4.3.70.0030.0109.72
4.3.60.0000.0239.72
4.3.50.0030.0139.72
4.3.40.0000.0239.72
4.3.30.0000.0309.72
4.3.20.0030.0339.72
4.3.10.0000.0309.72
4.3.00.0000.0209.72

preferences:
40.49 ms | 401 KiB | 5 Q