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($item->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.0090.00616.88
8.3.50.0070.01123.05
8.3.40.0000.01419.08
8.3.30.0160.00319.13
8.3.20.0040.00420.16
8.3.10.0080.00023.36
8.3.00.0040.00419.63
8.2.180.0090.00618.79
8.2.170.0150.00022.96
8.2.160.0090.00620.47
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0040.00421.10
8.2.110.0100.00019.31
8.2.100.0090.00317.91
8.2.90.0000.01018.09
8.2.80.0080.00517.97
8.2.70.0060.00318.16
8.2.60.0040.00417.92
8.2.50.0070.00019.21
8.2.40.0050.00520.17
8.2.30.0040.00418.05
8.2.20.0040.00417.84
8.2.10.0040.00418.09
8.2.00.0000.00718.01
8.1.280.0110.00725.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00622.05
8.1.230.0070.00422.67
8.1.220.0000.00817.74
8.1.210.0060.00318.99
8.1.200.0000.00817.48
8.1.190.0090.00317.38
8.1.180.0040.00418.10
8.1.170.0040.00418.58
8.1.160.0030.00522.05
8.1.150.0050.00318.92
8.1.140.0070.00317.57
8.1.130.0030.00317.85
8.1.120.0000.00717.63
8.1.110.0080.00017.61
8.1.100.0000.00817.68
8.1.90.0070.00017.59
8.1.80.0000.00717.66
8.1.70.0000.00717.59
8.1.60.0000.00817.79
8.1.50.0040.00417.64
8.1.40.0030.00617.71
8.1.30.0030.00617.79
8.1.20.0030.00517.86
8.1.10.0040.00417.73
8.1.00.0080.00017.75
8.0.300.0000.00720.14
8.0.290.0040.00417.00
8.0.280.0050.00218.36
8.0.270.0030.00317.31
8.0.260.0060.00017.30
8.0.250.0030.00317.24
8.0.240.0030.00617.14
8.0.230.0040.00417.15
8.0.220.0040.00417.12
8.0.210.0050.00317.08
8.0.200.0000.00617.09
8.0.190.0040.00417.18
8.0.180.0070.00417.13
8.0.170.0050.00317.02
8.0.160.0000.00716.99
8.0.150.0030.00317.06
8.0.140.0040.00416.99
8.0.130.0060.00313.59
8.0.120.0040.00416.97
8.0.110.0040.00416.98
8.0.100.0050.00317.14
8.0.90.0040.00417.08
8.0.80.0080.00817.10
8.0.70.0070.00017.19
8.0.60.0000.00717.16
8.0.50.0040.00417.23
8.0.30.0100.01017.43
8.0.20.0150.00817.40
8.0.10.0000.00717.12
8.0.00.0110.00716.89
7.4.330.0080.00015.00
7.4.320.0030.00316.73
7.4.300.0060.00016.82
7.4.290.0040.00416.71
7.4.280.0000.00716.85
7.4.270.0080.00016.86
7.4.260.0030.00316.82
7.4.250.0030.00316.77
7.4.240.0020.00616.66
7.4.230.0070.00016.84
7.4.220.0030.01616.65
7.4.210.0090.00616.77
7.4.200.0000.00716.65
7.4.160.0040.01116.80
7.4.150.0110.00717.40
7.4.140.0100.00617.86
7.4.130.0090.00816.75
7.4.120.0070.01216.69
7.4.110.0060.01216.79
7.4.100.0000.02016.75
7.4.90.0120.00616.87
7.4.80.0130.00319.39
7.4.70.0100.00716.81
7.4.60.0110.00616.64
7.4.50.0030.00616.53
7.4.40.0070.01116.80
7.4.30.0070.01016.84
7.4.00.0040.01114.93
7.3.330.0060.00013.45
7.3.320.0000.00513.65
7.3.310.0030.00316.49
7.3.300.0070.00016.64
7.3.290.0130.00616.64
7.3.280.0070.01216.53
7.3.270.0090.00917.40
7.3.260.0080.01316.50
7.3.250.0130.00516.70
7.3.240.0110.00516.80
7.3.230.0100.00716.60
7.3.210.0100.00716.79
7.3.200.0060.00919.39
7.3.190.0120.00916.55
7.3.180.0060.01516.49
7.3.170.0060.01016.80
7.3.160.0070.00716.61
7.3.00.0070.00717.05
7.2.330.0000.01816.86
7.2.320.0100.00616.69
7.2.310.0030.01416.89
7.2.300.0120.00616.93
7.2.290.0140.00416.89
7.2.130.0110.00417.23
7.2.120.0060.00617.13
7.2.110.0000.01017.04
7.2.100.0070.01017.20
7.2.90.0090.00617.43
7.2.80.0060.00617.20
7.2.70.0070.01017.15
7.2.60.0050.01017.13
7.2.50.0060.01017.22
7.2.40.0120.00317.00
7.2.30.0030.01217.26
7.2.20.0090.00617.13
7.2.10.0060.00317.31
7.2.00.0040.01118.30
7.1.250.0030.01015.98
7.1.240.0060.00715.78
7.1.230.0060.00315.71
7.1.220.0040.01116.13
7.1.210.0000.01815.82
7.1.200.0070.00715.91
7.1.190.0090.00616.09
7.1.180.0040.00816.09
7.1.170.0070.00315.63
7.1.160.0030.01015.91
7.1.150.0080.00515.79
7.1.140.0090.00316.02
7.1.130.0030.01216.05
7.1.120.0060.00916.00
7.1.110.0100.00716.11
7.1.100.0040.00817.10
7.1.90.0030.01016.05
7.1.80.0100.00315.76
7.1.70.0030.01016.62
7.1.60.0100.00316.80
7.1.50.0070.01216.69
7.1.40.0060.00915.66
7.1.30.0060.00316.09
7.1.20.0100.00316.25
7.1.10.0000.01416.11
7.1.00.0070.03919.18
7.0.330.0000.01615.54
7.0.320.0070.00715.77
7.0.310.0100.00315.61
7.0.300.0070.00715.83
7.0.290.0110.00415.60
7.0.280.0100.00315.35
7.0.270.0070.00715.64
7.0.260.0050.00515.53
7.0.250.0000.00915.70
7.0.240.0060.00615.69
7.0.230.0030.01315.38
7.0.220.0030.01315.63
7.0.210.0040.00415.80
7.0.200.0070.00916.17
7.0.190.0110.00415.67
7.0.180.0060.00615.30
7.0.170.0040.01115.36
7.0.160.0090.00315.53
7.0.150.0110.00415.71
7.0.140.0030.04318.75
7.0.130.0070.00715.56
7.0.120.0090.00615.66
7.0.110.0110.00415.77
7.0.100.0000.01715.70
7.0.90.0070.00715.74
7.0.80.0000.01415.31
7.0.70.0040.01115.40
7.0.60.0080.02317.82
7.0.50.0090.03716.80
7.0.40.0040.02916.85
7.0.30.0120.03417.04
7.0.20.0150.02516.97
7.0.10.0060.04616.93
7.0.00.0050.02316.90
5.6.380.0000.00914.73
5.6.370.0030.00614.38
5.6.360.0030.00914.24
5.6.350.0060.00614.64
5.6.340.0090.00014.70
5.6.330.0030.01014.76
5.6.320.0030.00914.60
5.6.310.0000.01014.67
5.6.300.0070.00714.62
5.6.290.0030.01414.92
5.6.280.0000.04317.67
5.6.270.0080.00814.61
5.6.260.0080.00814.66
5.6.250.0110.00414.60
5.6.240.0120.00414.60
5.6.230.0060.00314.55
5.6.220.0040.00814.54
5.6.210.0040.02417.68
5.6.200.0070.03716.32
5.6.190.0070.03517.53
5.6.180.0140.02317.55
5.6.170.0130.03417.49
5.6.160.0070.02417.38
5.6.150.0070.03216.27
5.6.140.0050.03016.31
5.6.130.0060.04716.29
5.6.120.0080.02817.78
5.6.110.0050.03117.85
5.6.100.0050.04617.70
5.6.90.0050.04417.68
5.6.80.0080.04117.49
5.6.70.2230.02317.23
5.6.60.0100.00314.08
5.6.50.0030.00614.54
5.6.40.0050.00614.32
5.6.30.0030.00514.40
5.6.20.0030.00914.52
5.6.10.0090.00314.36
5.6.00.0060.00614.36
5.5.380.0060.00611.46
5.5.370.0060.00611.21
5.5.360.0030.00311.15
5.5.350.0100.04215.88
5.5.340.0030.03714.69
5.5.330.0080.03915.96
5.5.320.0170.02315.91
5.5.310.0180.04115.67
5.5.300.0050.02414.68
5.5.290.0030.04714.72
5.5.280.0070.03516.18
5.5.270.0050.02516.21
5.5.260.0030.03516.09
5.5.250.0080.04015.81
5.5.240.0150.03615.79
5.5.230.0000.01211.34
5.5.220.0070.00411.35
5.5.210.0040.00411.41
5.5.200.0030.01011.27
5.5.190.0000.01311.53
5.5.180.0000.01211.40
5.5.170.0030.01011.28
5.5.160.0090.00011.16
5.5.150.0030.01011.11
5.5.140.0080.00311.27
5.5.130.0040.00811.38
5.5.120.0030.00611.42
5.5.110.0060.00611.20
5.5.100.0030.00611.21
5.5.90.0080.00311.11
5.5.80.0000.01111.41
5.5.70.0060.00311.16
5.5.60.0090.00011.20
5.5.50.0030.00911.21
5.5.40.0000.00711.04
5.5.30.0040.00811.01
5.5.20.0030.00711.22
5.5.10.0040.00411.21
5.5.00.0000.00711.34
5.4.450.0210.02215.25
5.4.440.0080.02515.15
5.4.430.0050.02415.44
5.4.420.0320.02915.41
5.4.410.0150.02015.15
5.4.400.0050.02315.17
5.4.390.0120.02215.05
5.4.380.0200.02614.86
5.4.370.0170.03315.09
5.4.360.0120.02514.88
5.4.350.0100.03014.93
5.4.340.0200.03414.96
5.4.330.0030.00711.01
5.4.320.0020.02611.97
5.4.310.0060.01911.97
5.4.300.0090.01911.76
5.4.290.0080.02112.00
5.4.280.0080.01811.87
5.4.270.0060.02511.84
5.4.260.0080.02411.75
5.4.250.0060.02211.75
5.4.240.0050.02211.70
5.4.230.0040.02411.79
5.4.220.0050.02311.75
5.4.210.0020.02411.75
5.4.200.0070.02011.90
5.4.190.0060.02111.89
5.4.180.0060.02111.70
5.4.170.0070.02111.84
5.4.160.0060.02211.70
5.4.150.0040.02211.92
5.4.140.0040.02311.70
5.4.130.0080.01811.72
5.4.120.0050.01911.51
5.4.110.0050.02211.69
5.4.100.0040.02311.74
5.4.90.0020.02611.57
5.4.80.0040.02411.59
5.4.70.0070.01911.62
5.4.60.0090.01811.59
5.4.50.0050.02111.61
5.4.40.0090.01711.64
5.4.30.0070.01911.57
5.4.20.0080.02211.67
5.4.10.0090.02111.66
5.4.00.0060.02411.41
5.3.290.0060.02311.90
5.3.280.0040.02211.86
5.3.270.0040.02611.87
5.3.260.0050.02111.86
5.3.250.0060.02211.86
5.3.240.0040.02211.86
5.3.230.0060.02211.86
5.3.220.0040.02211.84
5.3.210.0050.02111.84
5.3.200.0020.02611.84
5.3.190.0050.02411.84
5.3.180.0070.02811.84
5.3.170.0070.02711.84
5.3.160.0080.02611.84
5.3.150.0050.02911.84
5.3.140.0050.02811.83
5.3.130.0080.02911.83
5.3.120.0040.03511.83
5.3.110.0060.03011.83
5.3.100.0060.02611.56
5.3.90.0060.02111.55
5.3.80.0070.02011.55
5.3.70.0050.02211.55
5.3.60.0050.02211.54
5.3.50.0050.02111.52
5.3.40.0040.02411.52
5.3.30.0070.01811.50
5.3.20.0050.02311.39
5.3.10.0090.02311.37
5.3.00.0070.02711.36
5.2.170.0060.01810.12
5.2.160.0090.02510.12
5.2.150.0040.02410.12
5.2.140.0020.02610.12
5.2.130.0060.02210.10
5.2.120.0020.02010.10
5.2.110.0050.01710.10
5.2.100.0070.01710.10
5.2.90.0020.01910.10
5.2.80.0050.01510.10
5.2.70.0060.01710.10
5.2.60.0030.01710.07
5.2.50.0060.01510.06
5.2.40.0050.01710.05
5.2.30.0060.01510.04
5.2.20.0060.01410.04
5.2.10.0060.0189.98
5.2.00.0070.0179.92
5.1.60.0050.0149.55
5.1.50.0050.0149.55
5.1.40.0010.0169.54
5.1.30.0040.0159.72
5.1.20.0020.0169.73
5.1.10.0020.0189.59
5.1.00.0050.0159.59
5.0.50.0060.0118.83
5.0.40.0040.0118.76
5.0.30.0040.0168.67
5.0.20.0040.0118.65
5.0.10.0030.0138.64
5.0.00.0020.0188.64
4.4.90.0030.0107.89
4.4.80.0030.0097.88
4.4.70.0020.0097.88
4.4.60.0020.0107.88
4.4.50.0020.0107.89
4.4.40.0030.0157.86
4.4.30.0030.0097.88
4.4.20.0020.0097.93
4.4.10.0030.0087.93
4.4.00.0010.0157.88
4.3.110.0020.0117.84
4.3.100.0030.0097.83
4.3.90.0050.0077.82
4.3.80.0010.0167.79
4.3.70.0020.0097.82
4.3.60.0010.0097.81
4.3.50.0020.0107.81
4.3.40.0020.0157.77
4.3.30.0040.0097.15
4.3.20.0030.0107.14
4.3.10.0020.0107.12
4.3.00.0060.01113.35

preferences:
49.25 ms | 401 KiB | 5 Q