3v4l.org

run code in 300+ PHP versions simultaneously
<?php $serialized = 'a:6:{s:2:"xs";a:5:{s:11:"contentType";s:10:"image/jpeg";s:13:"contentLength";s:4:"1024";s:5:"width";i:100;s:6:"height";i:100;s:4:"path";s:20:"/path/to/extra-small";}s:2:"sm";a:5:{s:11:"contentType";s:10:"image/jpeg";s:13:"contentLength";s:4:"2024";s:5:"width";i:200;s:6:"height";i:200;s:4:"path";s:14:"/path/to/small";}s:2:"md";a:5:{s:11:"contentType";s:10:"image/jpeg";s:13:"contentLength";s:4:"3024";s:5:"width";i:400;s:6:"height";i:400;s:4:"path";s:15:"/path/to/medium";}s:2:"lg";a:5:{s:11:"contentType";s:10:"image/jpeg";s:13:"contentLength";s:4:"4024";s:5:"width";i:800;s:6:"height";i:800;s:4:"path";s:15:"/path/to/medium";}s:2:"xl";a:5:{s:11:"contentType";s:10:"image/jpeg";s:13:"contentLength";s:4:"9024";s:5:"width";i:1200;s:6:"height";i:1200;s:4:"path";s:11:"/path/to/xl";}s:1:"o";a:5:{s:11:"contentType";s:10:"image/jpeg";s:13:"contentLength";s:5:"28160";s:5:"width";i:2300;s:6:"height";i:2300;s:4:"path";s:17:"/path/to/original";}}'; $json = '{"xs":{"contentType":"image\/jpeg","contentLength":"1024","width":100,"height":100,"path":"\/path\/to\/extra-small"},"sm":{"contentType":"image\/jpeg","contentLength":"2024","width":200,"height":200,"path":"\/path\/to\/small"},"md":{"contentType":"image\/jpeg","contentLength":"3024","width":400,"height":400,"path":"\/path\/to\/medium"},"lg":{"contentType":"image\/jpeg","contentLength":"4024","width":800,"height":800,"path":"\/path\/to\/medium"},"xl":{"contentType":"image\/jpeg","contentLength":"9024","width":1200,"height":1200,"path":"\/path\/to\/xl"},"o":{"contentType":"image\/jpeg","contentLength":"28160","width":2300,"height":2300,"path":"\/path\/to\/original"}}'; $start = microtime(true); for ($i = 0; $i<100000; $i++) { $data = unserialize($serialized); //print_r($data); } printf("%.5f\n", microtime(true) - $start); $start = microtime(true); for ($i = 0; $i<100000; $i++) { $decoded = json_decode($json, true); //print_r($decoded); } printf("%.5f\n", microtime(true) - $start);

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)
7.4.00.0131.75214.73
7.3.120.0071.88214.79
7.3.110.0131.29914.91
7.3.100.0031.74414.61
7.3.90.0001.32114.77
7.3.80.0001.72114.97
7.3.70.0031.81014.95
7.3.60.0031.72314.55
7.3.50.0072.02714.81
7.3.40.0031.96214.96
7.3.30.0001.62914.97
7.3.20.0031.39216.57
7.3.10.0031.49616.68
7.3.00.0131.23216.47
7.2.250.0072.05914.79
7.2.240.0131.49215.00
7.2.230.0031.92414.90
7.2.220.0031.78714.96
7.2.210.0071.52214.75
7.2.200.0071.61115.11
7.2.190.0001.50215.04
7.2.180.0071.71215.08
7.2.170.0001.71915.10
7.2.00.0030.94819.10
7.1.330.0071.96115.61
7.1.320.0031.91915.89
7.1.310.0071.61715.67
7.1.300.0032.12115.60
7.1.290.0032.09015.73
7.1.280.0071.92415.70
7.1.270.0071.40015.76
7.1.260.0031.63115.86
7.1.70.0000.89117.28
7.1.60.0030.89519.32
7.1.50.0070.94317.00
7.1.00.0000.98022.42
7.0.200.0071.13116.79
7.0.140.0030.99722.18
7.0.120.0100.99322.14
7.0.110.0031.01322.13
7.0.100.0101.01022.12
7.0.90.0001.01322.14
7.0.80.0070.99022.05
7.0.70.0071.00322.20
7.0.60.0030.98322.09
7.0.50.0031.00322.11
7.0.40.0001.01022.16
7.0.30.0031.01322.18
7.0.20.0000.99022.16
7.0.10.0001.00022.04
7.0.00.0100.98722.07
5.6.280.0031.50021.09
5.6.260.0031.44720.96
5.6.250.0071.42721.12
5.6.240.0101.46720.90
5.6.230.0001.47720.87
5.6.220.0071.42721.07
5.6.210.0031.45720.67
5.6.200.0101.45720.79
5.6.190.0001.44020.80
5.6.180.0031.46020.75
5.6.170.0031.44720.75
5.6.160.0031.44720.83
5.6.150.0071.45720.82
5.6.140.0031.46721.03
5.6.130.0101.48021.05
5.6.120.0101.42720.84
5.6.110.0031.42721.07
5.6.100.0101.40721.08
5.6.90.0101.41320.91
5.6.80.0031.43320.44
5.6.70.0071.40720.34
5.6.60.0001.39720.29
5.6.50.0001.41020.44
5.6.40.0031.41720.15
5.6.30.0001.44320.20
5.6.20.0071.39720.14
5.6.10.0001.40020.35
5.6.00.0101.41320.43
5.5.380.0031.49717.52
5.5.370.0071.51017.44
5.5.360.0071.66317.62
5.5.350.0031.46317.52
5.5.340.0031.67718.25
5.5.330.0031.47317.77
5.5.320.0031.48018.15
5.5.310.0031.44718.09
5.5.300.0001.41317.84
5.5.290.0071.45318.15
5.5.280.0071.45017.76
5.5.270.0071.46318.03
5.5.260.0001.48018.25
5.5.250.0001.46717.94
5.5.240.0031.44017.25
5.5.230.0031.46017.24
5.5.220.0001.45017.53
5.5.210.0071.58717.28
5.5.200.0031.38717.19
5.5.190.0031.40717.48
5.5.180.0031.40717.45
5.5.160.0071.38717.45
5.5.150.0031.41017.21
5.5.140.0001.43017.35
5.5.130.0031.41717.45
5.5.120.0031.40317.19
5.5.110.0071.41017.44
5.5.100.0001.42717.27
5.5.90.0031.40717.43
5.5.80.0001.43017.13
5.5.70.0001.42017.10
5.5.60.0031.39017.08
5.5.50.0071.38317.48
5.5.40.0071.38317.36
5.5.30.0001.42317.00
5.5.20.0031.42017.16
5.5.10.0001.45317.33
5.5.00.0031.42317.35
5.4.450.0071.43019.34
5.4.440.0001.39319.59
5.4.430.0071.38319.39
5.4.420.0031.39719.58
5.4.410.0071.60719.21
5.4.400.0071.37319.25
5.4.390.0001.42319.09
5.4.380.0001.37018.92
5.4.370.0001.36018.99
5.4.360.0071.36019.15
5.4.350.0071.38319.00
5.4.340.0031.38319.11
5.4.320.0071.36319.01
5.4.310.0071.37019.26
5.4.300.0031.39318.94
5.4.290.0001.38019.07
5.4.280.0001.38019.13
5.4.270.0031.42719.25
5.4.260.0031.38019.07
5.4.250.0071.35318.93
5.4.240.0031.36019.26
5.4.230.0001.40018.98
5.4.220.0071.38018.98
5.4.210.0071.37019.06
5.4.200.0001.38019.01
5.4.190.0031.35319.00
5.4.180.0001.38018.98
5.4.170.0001.36718.91
5.4.160.0001.39318.90
5.4.150.0001.38718.90
5.4.140.0001.50716.49
5.4.130.0001.35716.55
5.4.120.0031.34716.41
5.4.110.0001.35016.52
5.4.100.0031.31716.49
5.4.90.0001.36316.28
5.4.80.0071.42316.47
5.4.70.0001.37316.46
5.4.60.0001.40716.21
5.4.50.0001.36016.21
5.4.40.0031.61716.43
5.4.30.0001.39016.34
5.4.20.0001.37316.34
5.4.10.0031.37316.50
5.4.00.0031.39715.65
5.3.290.0071.35314.71
5.3.280.0031.37714.54
5.3.270.0001.43714.42
5.3.260.0031.51014.49
5.3.250.0101.40314.57
5.3.240.0071.38714.62
5.3.230.0031.41014.63
5.3.220.0031.52314.49
5.3.210.0001.51314.66
5.3.200.0101.50014.61
5.3.190.0071.50314.53
5.3.180.0001.50714.64
5.3.170.0001.50314.50
5.3.160.0031.49314.41
5.3.150.0031.51014.48
5.3.140.0001.51714.61
5.3.130.0071.51714.49
5.3.120.0031.51014.63
5.3.110.0031.51014.67
5.3.100.0001.49313.93
5.3.90.0001.51014.11
5.3.80.0001.45714.10
5.3.70.0071.48013.91
5.3.60.0001.47313.97
5.3.50.0031.52013.80
5.3.40.0031.47013.80
5.3.30.0031.46713.75
5.3.20.0001.48713.58
5.3.10.0031.67013.52
5.3.00.0001.50713.68
5.2.170.0031.48312.97
5.2.160.0001.50312.97
5.2.150.0001.50712.97
5.2.140.0031.47312.97
5.2.130.0031.50012.97
5.2.120.0031.48312.97
5.2.110.0031.49712.97
5.2.100.0001.46012.97
5.2.90.0001.47312.97
5.2.80.0031.45312.97
5.2.70.0071.53712.97
5.2.60.0031.48012.97
5.2.50.0071.48312.97
5.2.40.0031.49712.97
5.2.30.0031.46312.97
5.2.20.0031.46312.97
5.2.10.0031.44312.97
5.2.00.0071.38012.97
5.1.60.0030.54312.97
5.1.50.0000.53312.97
5.1.40.0070.79312.97
5.1.30.0030.63712.97
5.1.20.0070.53712.97
5.1.10.0030.55012.97
5.1.00.0070.56012.97
5.0.50.0000.60312.97
5.0.40.0100.80312.97
5.0.30.0030.68312.97
5.0.20.0000.55312.97
5.0.10.0000.56312.97
5.0.00.0030.75712.97
4.4.90.0030.62312.97
4.4.80.0000.61712.97
4.4.70.0000.63312.97
4.4.60.0000.63712.97
4.4.50.0000.57712.97
4.4.40.0000.84712.97
4.4.30.0030.92312.97
4.4.20.0000.62712.97
4.4.10.0000.62712.97
4.4.00.0030.63012.97
4.3.110.0000.61712.97
4.3.100.0000.67312.97
4.3.90.0000.55312.97
4.3.80.0030.55012.97
4.3.70.0000.54712.97
4.3.60.0030.67012.97
4.3.50.0030.53712.97
4.3.40.0030.54312.97
4.3.30.0000.62712.97
4.3.20.0000.57312.97
4.3.10.0000.62312.97
4.3.00.0000.58312.97

preferences:
37.77 ms | 400 KiB | 5 Q