3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo getRelativePath("/mnt/hgfs/home/Project1/src/AppBundle/Form/RegistrationType.php", "/mnt/hgfs/home/Project1/app"); function getRelativePath($path, $rootPath, $maxDepthCheck = 10){ if (0 === strpos($path, $rootPath)) { return substr($path, strlen($rootPath)); } $ds = DIRECTORY_SEPARATOR; $rootDirectoryArray = explode($ds, $rootPath); $pathDirectoryArray = explode($ds, $path); $relativePath = $ds; foreach ($rootDirectoryArray as $index => $rootCurrentDirectory) { var_dump($pathDirectoryArray); $pathCurrentDirectory = array_shift($pathDirectoryArray); if ($pathCurrentDirectory !== $rootCurrentDirectory) { $relativePath = $ds . '..' . $relativePath . $pathCurrentDirectory . $ds; } } return $relativePath.implode($ds, $pathDirectoryArray); }

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.0070.00718.28
8.3.50.0130.00721.96
8.3.40.0130.00918.71
8.3.30.0110.00418.72
8.3.20.0070.00021.85
8.3.10.0040.00423.53
8.3.00.0080.00019.66
8.2.180.0160.00618.16
8.2.170.0040.01122.96
8.2.160.0070.00719.22
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0110.00426.16
8.2.120.0040.00421.18
8.2.110.0030.00621.04
8.2.100.0030.00918.22
8.2.90.0000.00819.08
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0000.00818.03
8.2.50.0050.00318.10
8.2.40.0050.00520.62
8.2.30.0000.00719.25
8.2.20.0030.00517.75
8.2.10.0040.00418.21
8.2.00.0050.00218.20
8.1.280.0070.01125.92
8.1.270.0060.00323.91
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.00421.42
8.1.230.0080.00417.46
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0070.00417.13
8.1.190.0050.00317.36
8.1.180.0090.00018.10
8.1.170.0040.00418.46
8.1.160.0050.00222.14
8.1.150.0050.00218.77
8.1.140.0000.00819.53
8.1.130.0030.00317.57
8.1.120.0020.00517.46
8.1.110.0050.00217.35
8.1.100.0070.00017.43
8.1.90.0040.00417.52
8.1.80.0040.00417.34
8.1.70.0030.00317.36
8.1.60.0030.00617.55
8.1.50.0040.00417.53
8.1.40.0040.00417.40
8.1.30.0040.00417.71
8.1.20.0000.00817.64
8.1.10.0000.00917.45
8.1.00.0040.00417.48
8.0.300.0000.00718.77
8.0.290.0060.00316.75
8.0.280.0000.00718.32
8.0.270.0040.00417.21
8.0.260.0070.00017.25
8.0.250.0000.00716.95
8.0.240.0000.00716.97
8.0.230.0000.00716.99
8.0.220.0040.00416.87
8.0.210.0040.00416.79
8.0.200.0060.00016.96
8.0.190.0040.00416.92
8.0.180.0030.00516.81
8.0.170.0040.00416.96
8.0.160.0040.00416.96
8.0.150.0000.00716.73
8.0.140.0040.00416.89
8.0.130.0040.00213.36
8.0.120.0070.00316.86
8.0.110.0040.00416.75
8.0.100.0040.00416.93
8.0.90.0000.00716.77
8.0.80.0070.01016.89
8.0.70.0000.00916.75
8.0.60.0040.00416.74
8.0.50.0040.00416.94
8.0.30.0130.00816.92
8.0.20.0110.00917.40
8.0.10.0040.00417.04
8.0.00.0130.00716.89
7.4.330.0030.00315.21
7.4.320.0000.00716.43
7.4.300.0080.00016.51
7.4.290.0000.00716.62
7.4.280.0000.00816.50
7.4.270.0030.00316.52
7.4.260.0030.00316.57
7.4.250.0030.00316.61
7.4.240.0050.00316.50
7.4.230.0000.00716.58
7.4.220.0160.01016.63
7.4.210.0100.01016.58
7.4.200.0000.00816.35
7.4.160.0130.00416.38
7.4.150.0210.00417.40
7.4.140.0100.01017.86
7.4.130.0110.01216.58
7.4.120.0140.00616.52
7.4.110.0100.01416.40
7.4.100.0110.00716.61
7.4.90.0150.00416.41
7.4.80.0030.01319.39
7.4.70.0060.01816.52
7.4.60.0060.01316.55
7.4.50.0070.00716.41
7.4.40.0130.00616.58
7.4.30.0110.00716.50
7.4.00.0130.00315.11
7.3.330.0050.00013.39
7.3.320.0000.00613.38
7.3.310.0070.00016.34
7.3.300.0070.00016.27
7.3.290.0060.01016.32
7.3.280.0100.00716.36
7.3.270.0050.01417.40
7.3.260.0110.00816.38
7.3.250.0110.01116.44
7.3.240.0050.01616.40
7.3.230.0130.00816.39
7.3.210.0070.01116.29
7.3.200.0070.01016.70
7.3.190.0070.01016.38
7.3.180.0120.01216.50
7.3.170.0110.00616.48
7.3.160.0190.00416.41
7.3.10.0070.00716.67
7.3.00.0050.00916.62
7.2.330.0170.00216.74
7.2.320.0150.00916.76
7.2.310.0080.01416.70
7.2.300.0090.01116.81
7.2.290.0100.01016.75
7.2.130.0020.01016.91
7.2.120.0050.00916.94
7.2.110.0050.00916.79
7.2.100.0030.00917.03
7.2.90.0020.01116.82
7.2.80.0050.01016.87
7.2.70.0050.00717.02
7.2.60.0060.00516.93
7.2.50.0030.00816.92
7.2.40.0040.00917.08
7.2.30.0040.00916.96
7.2.20.0070.00516.85
7.2.10.0020.01116.95
7.2.00.0000.01217.64
7.1.250.0040.00815.94
7.1.240.0070.01015.68
7.1.230.0100.00315.83
7.1.220.0030.00715.95
7.1.210.0060.00615.79
7.1.200.0040.00915.70
7.1.190.0030.00915.87
7.1.180.0070.00715.98
7.1.170.0080.00515.80
7.1.160.0090.00615.78
7.1.150.0080.00415.79
7.1.140.0040.00715.80
7.1.130.0030.00615.58
7.1.120.0030.01215.89
7.1.110.0060.00615.65
7.1.100.0100.00315.63
7.1.90.0060.00615.49
7.1.80.0070.00715.91
7.1.70.0060.00216.51
7.1.60.0030.00917.71
7.1.50.0070.00715.81
7.1.40.0000.01315.87
7.1.30.0030.00615.71
7.1.20.0040.00715.79
7.1.10.0030.00715.90
7.1.00.0030.04019.01
7.0.330.0070.00415.48
7.0.320.0000.01315.21
7.0.310.0070.00715.51
7.0.300.0000.01315.42
7.0.290.0130.00015.24
7.0.280.0050.00315.37
7.0.270.0000.01015.56
7.0.260.0030.01015.39
7.0.250.0080.00415.50
7.0.240.0030.01015.41
7.0.230.0060.00915.39
7.0.220.0070.00415.31
7.0.210.0070.00415.41
7.0.200.0050.01016.26
7.0.190.0110.00015.42
7.0.180.0060.00615.51
7.0.170.0040.00415.37
7.0.160.0060.00615.29
7.0.150.0070.00715.50
7.0.140.0030.00615.27
7.0.130.0030.00615.32
7.0.120.0030.00615.54
7.0.110.0000.00715.52
7.0.100.0030.00615.24
7.0.90.0120.02617.65
7.0.80.0100.03017.67
7.0.70.0120.03517.71
7.0.60.0110.02817.68
7.0.50.0100.03118.04
7.0.40.0070.03916.85
7.0.30.0030.03517.01
7.0.20.0130.02716.96
7.0.10.0180.03317.00
7.0.00.0170.03316.87
5.6.380.0040.01114.54
5.6.370.0070.00313.97
5.6.360.0040.00413.98
5.6.350.0050.00514.36
5.6.340.0070.00714.49
5.6.330.0000.01414.29
5.6.320.0070.00314.58
5.6.310.0040.00714.37
5.6.300.0060.00314.53
5.6.290.0070.00714.22
5.6.280.0030.00914.20
5.6.270.0040.01114.11
5.6.260.0040.00714.61
5.6.250.0080.00414.05
5.6.240.0070.03417.56
5.6.230.0160.02617.50
5.6.220.0170.03717.33
5.6.210.0050.03517.54
5.6.200.0080.03017.66
5.6.190.0100.02817.65
5.6.180.0030.03517.69
5.6.170.0100.03217.63
5.6.160.0070.03017.63
5.6.150.0050.03617.62
5.6.140.0190.02517.87
5.6.130.0100.03417.82
5.6.120.0050.03717.81
5.6.110.0080.03217.74
5.6.100.0110.02917.64
5.6.90.0120.02817.58
5.6.80.0050.03317.34
5.6.70.0160.02317.39
5.6.60.0080.03317.39
5.6.50.0040.03417.46
5.6.40.0080.03217.21
5.6.30.0090.03017.34
5.6.20.0080.02917.38
5.6.10.0110.02917.35
5.6.00.0090.02817.36

preferences:
32.5 ms | 401 KiB | 5 Q