3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Object { // protected $hasMany; protected $theSignificativeProperties = ['nome', 'login']; public function getHasMany() { return $this->hasMany; } public function getSignificativeProperties() { return $this->theSignificativeProperties; } } class Aluno extends Object { private $nome; private $login; protected $hasMany = ['post', 'disciplina']; protected $theSignificativeProperties = ['nome', 'login']; /*public function getHasMany() { return $this->hasMany; }*/ /*public function getSignificativeProperties() { return $this->theSignificativeProperties; }*/ } class Post extends Object { // } class Disciplina extends Object { protected $hasMany = ['aluno']; } class EntityManager { // } class RelationalEntityManager extends EntityManager { public function find() { // echo 'Usando o RelationalEntityManager.'; } } class BaseController { private $objectService; public function __construct() { $this->objectService = new BaseObjectService(new RelationalEntityManager()); } public function view() { $args = func_get_args(); $this->objectService->view($args); } } class BaseObjectService { private $em; public function __construct(EntityManager $entityManager) { $this->em = $entityManager; } public function view($args) { // echo 'Argumentos: '; print_r($args); $em->find(); } } echo 'Aluno: ' . class_exists('Aluno') . '<br>'; echo 'Teste: '; var_dump(class_exists('Teste')) . '\n'; $a = new Aluno(); print_r ( $a->getSignificativeProperties() ); $controller = new BaseController(); $controller->view('marcelo', 'boi', 1);

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.40.0120.00418.49
8.3.30.0070.01118.35
8.3.20.0070.00020.16
8.3.10.0040.00421.58
8.3.00.0040.00417.59
8.2.170.0000.01522.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0110.00020.75
8.2.110.0100.00019.21
8.2.100.0000.01217.91
8.2.90.0030.00518.87
8.2.80.0040.00417.97
8.2.70.0080.00017.38
8.2.60.0060.00317.91
8.2.50.0050.00318.10
8.2.40.0000.00720.45
8.2.30.0040.00420.96
8.2.20.0000.00817.99
8.2.10.0030.00617.80
8.2.00.0030.00617.98
8.1.270.0080.00023.86
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.05
8.1.230.0040.00817.46
8.1.220.0070.00017.74
8.1.210.0110.00018.77
8.1.200.0030.00617.22
8.1.190.0000.00817.10
8.1.180.0040.00418.10
8.1.170.0030.00818.29
8.1.160.0040.00418.99
8.1.150.0050.00520.45
8.1.140.0040.00419.45
8.1.130.0000.00718.66
8.1.120.0000.00817.34
8.1.110.0080.00017.36
8.1.100.0040.00417.21
8.1.90.0040.00417.33
8.1.80.0040.00417.37
8.1.70.0000.00817.38
8.1.60.0040.00417.36
8.1.50.0000.00817.40
8.1.40.0000.00817.40
8.1.30.0000.00717.54
8.1.20.0060.00617.45
8.1.10.0000.00817.38
8.1.00.0040.00417.36
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0070.00018.18
8.0.270.0060.00317.14
8.0.260.0030.00316.66
8.0.250.0070.00016.79
8.0.240.0040.00416.91
8.0.230.0030.00716.79
8.0.220.0000.00716.69
8.0.210.0030.00616.86
8.0.200.0030.00316.84
8.0.190.0030.00616.75
8.0.180.0070.00016.73
8.0.170.0000.00716.70
8.0.160.0000.01116.90
8.0.150.0000.00816.75
8.0.140.0030.00316.77
8.0.130.0050.00013.24
8.0.120.0000.00816.73
8.0.110.0030.00316.68
8.0.100.0000.00716.87
8.0.90.0000.00816.78
8.0.80.0090.00616.88
8.0.70.0000.00716.81
8.0.60.0000.00716.72
8.0.50.0020.00516.70
8.0.30.0090.00916.94
8.0.20.0120.00917.40
8.0.10.0030.00316.77
8.0.00.0140.00316.58
7.4.330.0050.00015.55
7.4.320.0030.00316.47
7.4.300.0030.00316.26
7.4.290.0090.00016.50
7.4.280.0040.00516.27
7.4.270.0000.00716.45
7.4.260.0030.00313.13
7.4.250.0040.00416.33
7.4.240.0080.00016.48
7.4.230.0000.00716.43
7.4.220.0130.01316.53
7.4.210.0100.00316.41
7.4.200.0070.00016.38
7.4.160.0070.00916.40
7.4.150.0140.00317.40
7.4.140.0100.01217.86
7.4.130.0130.01316.34
7.4.120.0120.00716.36
7.4.110.0090.00916.26
7.4.100.0130.01016.29
7.4.90.0120.01016.25
7.4.80.0120.00919.39
7.4.70.0070.01116.37
7.4.60.0030.01316.43
7.4.50.0040.01516.30
7.4.40.0030.01316.55
7.4.30.0040.01116.45
7.4.00.0070.00814.70
7.3.330.0050.00313.05
7.3.320.0050.00012.91
7.3.310.0030.00316.26
7.3.300.0000.00616.06
7.3.290.0060.01016.17
7.3.280.0090.00716.20
7.3.270.0200.00417.40
7.3.260.0110.00616.32
7.3.250.0140.00516.28
7.3.240.0080.00916.25
7.3.230.0060.01016.23
7.3.210.0030.01316.36
7.3.200.0080.00816.23
7.3.190.0170.00016.25
7.3.180.0000.01516.25
7.3.170.0140.00316.46
7.3.160.0060.00916.32
7.3.120.0060.01114.65
7.3.110.0080.01114.55
7.3.100.0040.01114.86
7.3.90.0030.00714.59
7.3.80.0090.00514.54
7.3.70.0030.01114.64
7.3.60.0080.00814.72
7.3.50.0030.01014.70
7.3.40.0070.00714.67
7.3.30.0060.00814.61
7.3.20.0080.01016.41
7.3.10.0040.00916.44
7.3.00.0070.00716.45
7.2.330.0100.00916.51
7.2.320.0100.00716.46
7.2.310.0030.01316.50
7.2.300.0160.00316.37
7.2.290.0110.00516.52
7.2.250.0100.00614.66
7.2.240.0050.01515.00
7.2.230.0110.00514.76
7.2.220.0040.01114.90
7.2.210.0050.00714.96
7.2.200.0000.01014.99
7.2.190.0050.00914.66
7.2.180.0060.00814.75
7.2.170.0040.00914.67
7.2.60.0100.00316.69
7.2.00.0060.00619.16
7.1.330.0030.01115.84
7.1.320.0040.00515.82
7.1.310.0050.00715.79
7.1.300.0030.01115.70
7.1.290.0050.00615.83
7.1.280.0050.01015.93
7.1.270.0090.00515.74
7.1.260.0060.00815.76
7.1.200.0030.00715.77
7.1.100.0080.00818.00
7.1.70.2770.01015.05
7.1.60.2400.01332.92
7.1.50.2300.01732.76
7.1.40.2000.01332.52
7.1.30.2300.01332.80
7.1.20.1870.01732.38
7.1.10.2670.01314.70
7.1.00.2100.00714.85
7.0.200.3130.00714.88
7.0.190.3030.00714.94
7.0.180.2230.00714.52
7.0.170.2330.00714.38
7.0.160.2800.01714.22
7.0.150.2170.01314.33
7.0.140.2270.00714.55
7.0.130.1700.01714.65
7.0.120.1870.01714.69
7.0.110.1770.01014.46
7.0.100.1970.01014.59
7.0.90.1670.00714.50
7.0.80.1830.01314.31
7.0.70.2230.01314.44
7.0.60.2000.01314.29
7.0.50.2270.00314.39
7.0.40.2130.00714.59
7.0.30.1870.00714.70
7.0.20.1730.01314.46
7.0.10.2070.00714.54
7.0.00.2200.00714.52

preferences:
46.4 ms | 400 KiB | 5 Q