3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Graph{ private $v; private $adjList; public function __construct($vertices){ $this->v=$vertices; $this->initAdjList(); } //@suppressWarnings("unchecked") private function initAdjList(){ $this->adjList = array($this->v); for($i=0; $i<$this->v;$i++){ $this->adjList[$i]=array(); } } public function addEdge($u, $v){ array_push($this->adjList[$u],$v); } public function printAllPaths($s, $d){ $isVisted=array(); $isVisted=array_fill(0,$this->v,false); $pathList=array(); array_push($pathList,$s); $this->printAllPathsUtil($s, $d, $isVisted,$pathList); } private function printAllPathsUtil($u,$d,$isVisted,$localPathList){ $isVisted[intval($u)]=true; if(intval($u)==intval($d)){ // echo $localPathList; print_r($localPathList); } foreach ($this->adjList as $i){ if(!$isVisted[intval($i)]){ array_push($localPathList,$i); $this->printAllPathsUtil($i, $d, $isVisted, $localPathList); array_splice($localPathList,intval($i),1); } } $isVisted[intval($u)]=false; } } $g=new Graph(5); $g->addEdge(0,1); $g->addEdge(0,2); $g->addEdge(0,3); $g->addEdge(2,0); $g->addEdge(2,1); $g->addEdge(1,3); $g->addEdge(3,1); $g->addEdge(3,2); $g->addEdge(4,3); $g->addEdge(3,4); $s=0; $d=4; $g->printAllPaths($s,$d);

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.70.0060.00916.75
8.3.60.0150.00318.55
8.3.50.0110.00417.97
8.3.40.0170.00019.02
8.3.30.0040.01218.84
8.3.20.0000.00819.15
8.3.10.0090.00020.86
8.3.00.0040.00423.48
8.2.190.0150.00016.75
8.2.180.0190.00018.30
8.2.170.0040.01122.96
8.2.160.0090.00620.52
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00020.92
8.2.120.0050.00326.35
8.2.110.0040.01822.13
8.2.100.0060.00617.91
8.2.90.0000.00819.36
8.2.80.0040.00417.97
8.2.70.0030.00517.93
8.2.60.0090.00017.80
8.2.50.0080.00018.10
8.2.40.0080.00019.23
8.2.30.0060.00319.42
8.2.20.0000.00718.25
8.2.10.0040.00418.11
8.2.00.0050.00319.54
8.1.280.0040.01125.92
8.1.270.0050.00324.02
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.32
8.1.230.0040.00719.08
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0070.00317.60
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0030.00618.63
8.1.160.0000.00718.83
8.1.150.0050.00318.95
8.1.140.0000.00717.65
8.1.130.0030.00318.96
8.1.120.0030.00617.42
8.1.110.0070.00017.52
8.1.100.0030.00517.52
8.1.90.0000.00817.43
8.1.80.0040.00417.50
8.1.70.0000.00917.51
8.1.60.0040.00417.57
8.1.50.0040.00417.42
8.1.40.0040.00417.54
8.1.30.0030.00617.55
8.1.20.0000.00817.55
8.1.10.0060.00517.63
8.1.00.0030.00617.50
8.0.300.0000.00819.28
8.0.290.0030.00616.88
8.0.280.0030.00518.48
8.0.270.0000.00717.23
8.0.260.0070.00017.32
8.0.250.0070.00017.00
8.0.240.0080.00016.91
8.0.230.0000.00717.00
8.0.220.0040.00716.92
8.0.210.0000.00716.98
8.0.200.0040.00417.04
8.0.190.0000.00717.08
8.0.180.0000.00816.89
8.0.170.0000.00917.00
8.0.160.0030.00316.95
8.0.150.0040.00416.83
8.0.140.0030.00516.97
8.0.130.0030.00313.38
8.0.120.0000.00716.97
8.0.110.0000.00816.82
8.0.100.0040.00316.79
8.0.90.0000.00716.95
8.0.80.0120.00716.92
8.0.70.0080.00016.79
8.0.60.0050.00216.74
8.0.50.0040.00416.93
8.0.30.0100.00717.06
8.0.20.0130.00917.43
8.0.10.0080.00016.89
8.0.00.0070.01216.88
7.4.330.0000.00615.55
7.4.320.0060.00016.56
7.4.300.0000.00716.52
7.4.290.0000.00716.43
7.4.280.0070.00016.66
7.4.270.0030.00316.57
7.4.260.0000.00816.48
7.4.250.0000.00716.64
7.4.240.0000.00716.57
7.4.230.0070.00016.43
7.4.220.0040.00416.47
7.4.210.0050.01216.62
7.4.200.0000.00816.50
7.4.160.0110.00816.59
7.4.140.0120.01217.86
7.4.130.0070.01016.50
7.4.120.0050.01216.67
7.4.110.0100.00716.69
7.4.100.0150.00616.44
7.4.90.0070.01016.50
7.4.80.0120.01219.39
7.4.70.0130.00316.58
7.4.60.0130.00616.77
7.4.50.0070.01016.45
7.4.40.0100.01016.58
7.4.00.0090.00614.77
7.3.330.0000.00513.25
7.3.320.0000.00513.41
7.3.310.0000.00716.30
7.3.300.0000.00716.43
7.3.290.0050.00216.28
7.3.280.0090.00616.42
7.3.260.0090.00916.49
7.3.240.0050.01216.49
7.3.230.0130.00316.48
7.3.210.0120.00616.61
7.3.200.0060.01116.71
7.3.190.0090.01216.63
7.3.180.0070.01016.48
7.3.170.0090.00916.63
7.3.160.0100.00716.69
7.3.10.0030.00916.38
7.3.00.0110.00416.70
7.2.330.0110.00916.86
7.2.320.0110.00716.84
7.2.310.0060.01616.84
7.2.300.0060.01116.46
7.2.290.0150.01216.73
7.2.130.0110.00816.81
7.2.120.0130.00616.92
7.2.110.0120.00416.77
7.2.100.0110.00916.96
7.2.90.0130.00717.04
7.2.80.0130.00316.91
7.2.70.0490.00715.70
7.2.60.0400.00715.75
7.2.50.0360.01015.63
7.2.40.0360.01015.86
7.2.30.0370.00815.86
7.2.20.0330.01115.60
7.2.10.0440.00515.68
7.2.00.0360.00915.47
7.1.250.0190.00315.59
7.1.200.0070.00715.71
7.1.170.0550.00813.85
7.1.160.0510.00614.04
7.1.150.0530.00513.92
7.1.140.0650.00514.08
7.1.130.0580.00513.96
7.1.120.0490.00813.83
7.1.110.0570.00714.05
7.1.100.0500.00614.07
7.1.90.0740.01013.89
7.1.80.0790.00713.74
7.1.70.0750.00813.88
7.1.60.0870.01331.64
7.1.50.1160.01531.84
7.1.40.1350.01531.81
7.1.30.1130.01331.61
7.1.20.1120.01131.74
7.1.10.0960.00313.83
7.1.00.0670.00614.00

preferences:
48.43 ms | 401 KiB | 5 Q