3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class = 'VeryStrangeThirdPartyLibraryName\\This\\Is\\A\\Very\\Long\\Namespace\\Path\\With\\Many\\Parts\\To\\This\\Class'; $iterations = 100000; foreach (range(0, 9) as $iteration) { $start = microtime(true); for ($i = 0; $i < $iterations; $i++) { if (0 === strpos($class, 'Yii\\')) { } } $finish = microtime(true) - $start; $startOlympiad = microtime(true); for ($i = 0; $i < $iterations; $i++) { if ('Yii\\' === substr($class, 0, 4)) { } } $finishOlympiad = microtime(true) - $startOlympiad; var_dump($finish); var_dump($finishOlympiad); var_dump('-------------'); }

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.10.0100.16314.84
7.4.00.0050.15314.87
7.3.130.0070.19814.59
7.3.120.0080.18414.71
7.3.110.0100.16314.87
7.3.100.0070.17114.84
7.3.90.0050.17214.82
7.3.80.0030.14914.71
7.3.70.0020.15314.72
7.3.60.0050.12614.84
7.3.50.0030.14114.80
7.3.40.0050.12914.80
7.3.30.0030.14914.69
7.3.20.0030.12316.50
7.3.10.0060.12616.47
7.3.00.0090.14016.45
7.2.260.0130.17814.92
7.2.250.0120.19915.14
7.2.240.0100.18914.94
7.2.230.0100.13914.95
7.2.220.0100.15915.12
7.2.210.0030.13714.93
7.2.200.0070.15715.09
7.2.190.0020.16515.07
7.2.180.0020.13414.92
7.2.170.0030.15814.82
7.2.160.0030.16214.89
7.2.150.0100.14216.65
7.2.140.0070.13616.94
7.2.130.0080.14216.77
7.2.120.0180.13516.92
7.2.110.0100.13316.64
7.2.100.0120.13116.50
7.2.90.0050.15016.73
7.2.80.0100.14316.82
7.2.70.0120.14016.84
7.2.60.0100.15916.90
7.2.50.0130.15616.96
7.2.40.0100.13816.79
7.2.30.0080.14516.69
7.2.20.0070.14316.81
7.2.10.0100.13716.87
7.2.00.0090.12217.84
7.1.330.0030.28715.80
7.1.320.0050.26915.77
7.1.310.0020.26915.82
7.1.300.0050.26215.69
7.1.290.0020.28515.68
7.1.280.0030.26715.67
7.1.270.0080.26015.62
7.1.260.0050.28215.66
7.1.250.0120.27315.83
7.1.240.0100.25016.01
7.1.230.0100.28215.77
7.1.220.0070.33015.56
7.1.210.0000.28115.98
7.1.200.0000.29515.81
7.1.190.0100.31515.81
7.1.180.0000.33315.97
7.1.170.0070.26615.78
7.1.160.0030.24515.94
7.1.150.0030.28915.75
7.1.140.0030.30515.59
7.1.130.0070.28016.00
7.1.120.0070.29015.89
7.1.110.0000.28615.90
7.1.100.0030.24816.00
7.1.90.0070.32315.86
7.1.80.0030.34115.86
7.1.70.0020.18816.45
7.1.60.0100.20517.62
7.1.50.0070.24116.33
7.1.40.0070.25815.58
7.1.30.0030.27515.84
7.1.20.0070.29215.95
7.1.10.0070.24915.78
7.1.00.0050.25619.03
7.0.330.0030.28315.49
7.0.320.0030.25615.46
7.0.310.0130.26015.53
7.0.300.0000.24915.26
7.0.290.0070.29615.54
7.0.280.0070.29415.40
7.0.270.0000.27015.29
7.0.260.0070.25215.44
7.0.250.0070.30015.59
7.0.240.0030.29615.39
7.0.230.0030.26915.50
7.0.220.0030.29615.51
7.0.210.0030.25415.47
7.0.200.0000.18415.98
7.0.190.0030.32115.45
7.0.180.0070.28515.47
7.0.170.0000.26915.44
7.0.160.0030.25015.28
7.0.150.0070.29415.50
7.0.140.0030.23618.80
7.0.130.0000.30615.60
7.0.120.0070.33415.32
7.0.110.0070.27315.21
7.0.100.0100.23317.62
7.0.90.0100.19017.54
7.0.80.0030.19317.68
7.0.70.0050.20117.59
7.0.60.0120.22817.71
7.0.50.0070.18817.83
7.0.40.0030.23916.84
7.0.30.0050.23116.85
7.0.20.0050.23716.74
7.0.10.0070.25516.67
7.0.00.0120.22516.86
5.6.400.0070.70214.39
5.6.390.0070.78514.40
5.6.380.0070.77514.24
5.6.370.0070.73614.25
5.6.360.0000.78314.32
5.6.350.0000.66514.50
5.6.340.0030.69314.58
5.6.330.0070.68814.66
5.6.320.0100.81014.28
5.6.310.0000.69214.11
5.6.300.0030.70214.78
5.6.290.0030.85314.13
5.6.280.0080.61417.67
5.6.270.0030.80214.32
5.6.260.0030.76314.38
5.6.250.0130.57117.30
5.6.240.0120.56717.46
5.6.230.0070.56817.40
5.6.220.0030.59417.42
5.6.210.0070.53017.47
5.6.200.0070.53517.67
5.6.190.0030.60617.88
5.6.180.0100.58917.73
5.6.170.0050.60517.81
5.6.160.0100.52817.58
5.6.150.0070.65517.60
5.6.140.0130.61917.73
5.6.130.0070.54017.56
5.6.120.0070.58217.71
5.6.110.0030.65317.77
5.6.100.0120.55217.65
5.6.90.0070.64117.58
5.6.80.0100.51117.42
5.6.70.0080.54517.33
5.6.60.0050.64917.36
5.6.50.0050.67317.26
5.6.40.0070.60917.44
5.6.30.0030.59617.41
5.6.20.0050.51317.30
5.6.10.0050.54617.35
5.6.00.0070.60417.48
5.5.380.0100.58117.18
5.5.370.0020.57917.50
5.5.360.0080.53717.45
5.5.350.0070.64017.45
5.5.340.0030.56017.64
5.5.330.0080.53517.60
5.5.320.0120.60517.52
5.5.310.0070.64417.66
5.5.300.0080.55517.55
5.5.290.0050.61017.66
5.5.280.0050.61417.49
5.5.270.0100.55317.55
5.5.260.0050.67817.45
5.5.250.0100.64217.54
5.5.240.0030.65217.00
5.5.230.0070.66417.16
5.5.220.0250.55017.29
5.5.210.0020.62417.22
5.5.200.0030.64117.36
5.5.190.0070.55717.20
5.5.180.0080.67417.12
5.5.170.0070.93814.11
5.5.160.0030.64317.16
5.5.150.0030.68617.07
5.5.140.0070.66617.26
5.5.130.0070.67117.24
5.5.120.0080.57717.14
5.5.110.0100.56017.10
5.5.100.0080.56217.30
5.5.90.0030.55817.21
5.5.80.0100.54417.11
5.5.70.0130.67517.10
5.5.60.0030.62217.15
5.5.50.0100.56817.08
5.5.40.0050.65617.06
5.5.30.0070.54417.07
5.5.20.0100.66217.27
5.5.10.0030.66117.23
5.5.00.0070.60817.15
5.4.450.0120.63215.25
5.4.440.0020.61215.10
5.4.430.0120.61315.26
5.4.420.0050.64715.10
5.4.410.0070.53015.06
5.4.400.0080.55414.98
5.4.390.0050.64815.06
5.4.380.0020.66014.95
5.4.370.0070.57214.98
5.4.360.0050.54414.86
5.4.350.0020.68814.95
5.4.340.0100.58714.84
5.4.330.0030.75310.87
5.4.320.0080.58615.19
5.4.310.0080.61214.91
5.4.300.0070.53415.11
5.4.290.0270.67815.04
5.4.280.0050.56114.94
5.4.270.0030.64515.01
5.4.260.0030.64514.81
5.4.250.0050.53114.98
5.4.240.0000.63815.11
5.4.230.0050.63014.92
5.4.220.0070.64115.03
5.4.210.0070.63114.86
5.4.200.0050.62814.91
5.4.190.0070.63115.00
5.4.180.0050.56515.04
5.4.170.0030.65814.70
5.4.160.0070.52814.82
5.4.150.0050.52915.01
5.4.140.0030.60613.52
5.4.130.0000.55513.52
5.4.120.0030.65813.62
5.4.110.0070.66013.46
5.4.100.0050.64813.61
5.4.90.0070.61913.49
5.4.80.0050.67013.74
5.4.70.0030.61113.51
5.4.60.0070.68913.65
5.4.50.0020.65713.63
5.4.40.0030.65713.68
5.4.30.0050.54213.63
5.4.20.0130.58913.77
5.4.10.0050.52713.61
5.4.00.0020.61513.19
5.3.290.0030.70812.56
5.3.280.0070.74312.54
5.3.270.0050.73112.54
5.3.260.0050.72612.55
5.3.250.0070.76912.49
5.3.240.0070.72112.35
5.3.230.0030.67712.46
5.3.220.0030.71112.35
5.3.210.0080.72412.42
5.3.200.0070.67112.42
5.3.190.0020.71412.44
5.3.180.0050.75412.52
5.3.170.0050.77412.53
5.3.160.0000.72412.34
5.3.150.0070.74212.36
5.3.140.0200.73112.47
5.3.130.0000.70112.50
5.3.120.0020.67512.36
5.3.110.0030.67412.42
5.3.100.0020.72912.23
5.3.90.0030.71612.15
5.3.80.0050.66812.11
5.3.70.0020.65112.00
5.3.60.0050.67612.15
5.3.50.0050.68112.19
5.3.40.0030.74012.07
5.3.30.0030.70312.13
5.3.20.0030.66611.94
5.3.10.0020.69711.91
5.3.00.0020.62811.82
5.2.170.0030.30711.18
5.2.160.0030.32311.19
5.2.150.0100.39011.14
5.2.140.0030.39011.00
5.2.130.0030.43311.12
5.2.120.0000.45711.17
5.2.110.0070.41010.95
5.2.100.0100.40011.17
5.2.90.0070.43011.14
5.2.80.0070.44711.10
5.2.70.0000.41011.11
5.2.60.0030.42711.10
5.2.50.0030.40010.84
5.2.40.0070.43710.92
5.2.30.0070.40310.83
5.2.20.0030.42010.95
5.2.10.0030.40310.78
5.2.00.0100.42310.74
5.1.60.0130.38710.15
5.1.50.0330.35010.04
5.1.40.0100.4109.96
5.1.30.0030.43710.25
5.1.20.0070.37710.42
5.1.10.0030.41310.13
5.1.00.0130.40010.21
5.0.50.0000.6508.67
5.0.40.0100.6608.44
5.0.30.0030.6378.42
5.0.20.0000.6308.42
5.0.10.0030.6578.42
5.0.00.0000.8908.42
4.4.90.0030.6108.42
4.4.80.0000.6508.42
4.4.70.0030.5738.42
4.4.60.0000.7138.42
4.4.50.0000.6178.42
4.4.40.0070.6508.42
4.4.30.0030.6578.42
4.4.20.0000.6508.42
4.4.10.0000.6138.42
4.4.00.0000.6938.42
4.3.110.0030.7238.42
4.3.100.0070.6038.42
4.3.90.0000.5538.42
4.3.80.0030.6278.42
4.3.70.0030.6408.42
4.3.60.0030.6408.42
4.3.50.0000.6678.42
4.3.40.0000.6108.42
4.3.30.0030.6108.42
4.3.20.0030.6178.42
4.3.10.0030.6978.42
4.3.00.0030.5978.42

preferences:
45.68 ms | 401 KiB | 5 Q