3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $prop1 = "I'm a class property!"; public function setProperty($newval) { $this->prop1 = $newval; } public function getProperty() { return $this->prop1 . "<br/>"; } } $obj = new MyClass;// Class instantiation. //var_dump($obj); echo "1st drill:"."<br>"; echo $obj->getProperty(); //echo prop1 string (// Get the property value). $obj->setProperty('I am a new property value'."<br><br>"); echo $obj->getProperty(); // Read it out again to show the change. //Second Drill echo "second drill: "."<br>"; class class2 { public $obj2="I am the first variable from the second drill."; public function setProperty2($newval2) { $this->obj2=$newval2; } public function getProperty2($newval2) { return $this->obj2."<br>"; } } // Create two objects $obj = new class2; $obj2 = new class2; // Get the value of $prop1 from both objects echo $obj->getProperty(); //taken from first drill. echo $obj2->getProperty(); // Set new values for both objects $obj->setProperty("I'm a new property value!"); $obj2->setProperty("I belong to the second instance!"."<br><br>"); // Output both objects' $prop1 value echo $obj->getProperty(); echo $obj2->getProperty();

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.0170.00018.68
8.3.50.0120.00922.88
8.3.40.0040.01118.92
8.3.30.0040.01118.83
8.3.20.0090.00020.16
8.3.10.0040.00420.69
8.3.00.0060.00320.71
8.2.180.0060.01216.88
8.2.170.0160.00622.96
8.2.160.0070.00722.20
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00021.04
8.2.120.0050.00326.35
8.2.110.0060.00319.22
8.2.100.0080.00417.80
8.2.90.0040.00419.28
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0000.00917.80
8.2.50.0080.00018.09
8.2.40.0050.00320.45
8.2.30.0060.00319.42
8.2.20.0040.00417.70
8.2.10.0070.00018.07
8.2.00.0000.00817.92
8.1.280.0070.01125.92
8.1.270.0090.00923.84
8.1.260.0050.00228.09
8.1.250.0040.00428.09
8.1.240.0030.00622.46
8.1.230.0070.00317.83
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0000.00817.38
8.1.180.0080.00018.10
8.1.170.0030.00918.60
8.1.160.0000.00720.86
8.1.150.0000.00920.59
8.1.140.0000.00919.66
8.1.130.0080.00017.78
8.1.120.0000.00717.46
8.1.110.0030.00517.50
8.1.100.0080.00017.38
8.1.90.0060.00317.42
8.1.80.0070.00317.54
8.1.70.0040.00417.50
8.1.60.0070.00017.60
8.1.50.0080.00017.50
8.1.40.0000.00717.49
8.1.30.0030.00517.76
8.1.20.0030.00617.70
8.1.10.0000.00817.64
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0080.00018.52
8.0.270.0040.00416.91
8.0.260.0030.00317.20
8.0.250.0070.00017.01
8.0.240.0050.00217.13
8.0.230.0000.00717.07
8.0.220.0030.00316.94
8.0.210.0060.00316.88
8.0.200.0030.00317.07
8.0.190.0000.00716.97
8.0.180.0030.00516.93
8.0.170.0040.00416.97
8.0.160.0000.00816.90
8.0.150.0000.00717.01
8.0.140.0000.00716.95
8.0.130.0030.00313.41
8.0.120.0000.00816.92
8.0.110.0030.00416.89
8.0.100.0040.00417.06
8.0.90.0000.00916.80
8.0.80.0000.02016.94
8.0.70.0040.00416.95
8.0.60.0000.00716.93
8.0.50.0050.00316.98
8.0.30.0090.00916.97
8.0.20.0120.00917.40
8.0.10.0000.00816.89
8.0.00.0090.00816.76
7.4.330.0000.00516.73
7.4.320.0070.00016.49
7.4.300.0000.00616.64
7.4.290.0070.00016.65
7.4.280.0040.00416.68
7.4.270.0040.00416.62
7.4.260.0000.00716.61
7.4.250.0000.00716.50
7.4.240.0000.00716.63
7.4.230.0040.00416.36
7.4.220.0090.01516.63
7.4.210.0040.01216.57
7.4.200.0000.00716.74
7.4.160.0070.01516.71
7.4.150.0060.01217.40
7.4.140.0120.01017.86
7.4.130.0090.00816.51
7.4.120.0100.01016.54
7.4.110.0030.01316.42
7.4.100.0140.00616.53
7.4.90.0070.01016.50
7.4.80.0190.00619.39
7.4.70.0110.00616.58
7.4.60.0100.00716.54
7.4.50.0000.01516.60
7.4.40.0050.01116.47
7.4.30.0140.00316.62
7.4.00.0040.01314.85
7.3.330.0000.00513.23
7.3.320.0000.00513.34
7.3.310.0070.00016.42
7.3.300.0020.00516.23
7.3.290.0050.00216.32
7.3.280.0060.01016.39
7.3.270.0090.00917.40
7.3.260.0120.00816.38
7.3.250.0120.00616.35
7.3.240.0130.00716.43
7.3.230.0080.01316.50
7.3.210.0080.00916.54
7.3.200.0060.01216.29
7.3.190.0070.01016.37
7.3.180.0040.01516.52
7.3.170.0060.01116.41
7.3.160.0090.00616.25
7.3.120.0080.00414.97
7.3.110.0070.01114.60
7.3.100.0070.00714.45
7.3.90.0090.00614.78
7.3.80.0090.00614.53
7.3.70.0030.00614.79
7.3.60.0000.01414.95
7.3.50.0030.01514.86
7.3.40.0110.00014.73
7.3.30.0100.00314.60
7.3.20.0070.01016.68
7.3.10.0070.00716.45
7.3.00.0000.01116.63
7.2.330.0140.00316.45
7.2.320.0140.00316.36
7.2.310.0030.01316.75
7.2.300.0060.01016.89
7.2.290.0110.00616.78
7.2.250.0000.01914.98
7.2.240.0060.01314.89
7.2.230.0070.00715.26
7.2.220.0030.01015.18
7.2.210.0060.00914.92
7.2.200.0030.01214.96
7.2.190.0030.00614.87
7.2.180.0000.01414.86
7.2.170.0050.00515.29
7.2.60.0030.01316.73
7.2.00.0060.00619.39
7.1.330.0060.01015.72
7.1.320.0060.00315.48
7.1.310.0030.01015.48
7.1.300.0070.00715.48
7.1.290.0040.01115.71
7.1.280.0040.00415.54
7.1.270.0060.00915.85
7.1.260.0070.00715.85
7.1.200.0060.00915.61
7.1.100.0070.00717.68
7.1.70.0050.00217.02
7.1.60.0100.01319.61
7.1.50.0170.00716.55
7.1.00.0000.08022.29
7.0.200.0060.00316.88
7.0.60.0070.07721.75
7.0.50.0100.06317.85
7.0.40.0030.04320.15
7.0.30.0170.04320.32
7.0.20.0300.07720.10
7.0.10.0030.04720.26
7.0.00.0100.04020.09
5.6.280.0070.07021.11
5.6.210.0000.04720.48
5.6.200.0070.04318.29
5.6.190.0170.07020.55
5.6.180.0200.04320.61
5.6.170.0270.04320.60
5.6.160.0030.07320.71
5.6.150.0030.08318.29
5.6.140.0070.04018.27
5.6.130.0030.04018.14
5.6.120.0100.03721.04
5.6.110.0130.07721.05
5.6.100.0030.06721.02
5.6.90.0100.08021.13
5.6.80.0070.08020.39
5.5.350.3870.03720.33
5.5.340.0170.06717.98
5.5.330.0130.08020.13
5.5.320.0270.06320.32
5.5.310.0200.04320.35
5.5.300.0130.07318.02
5.5.290.0130.07018.07
5.5.280.0030.04020.77
5.5.270.0130.07720.88
5.5.260.0070.07720.77
5.5.250.0130.07020.50
5.5.240.0030.08020.38

preferences:
54.02 ms | 401 KiB | 5 Q