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); echo 'Classe em questão: '; echo get_class($this); $this->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.60.0100.01016.75
8.3.50.0070.00716.27
8.3.40.0090.00618.55
8.3.30.0120.00318.67
8.3.20.0040.00420.16
8.3.10.0040.00421.56
8.3.00.0040.00417.66
8.2.180.0110.00716.59
8.2.170.0100.00722.96
8.2.160.0070.00720.47
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00022.20
8.2.120.0050.00326.35
8.2.110.0060.00320.47
8.2.100.0110.00017.78
8.2.90.0060.00319.11
8.2.80.0040.00417.97
8.2.70.0060.00317.25
8.2.60.0040.00417.79
8.2.50.0050.00318.10
8.2.40.0070.00020.60
8.2.30.0000.00820.95
8.2.20.0030.00517.92
8.2.10.0000.00817.98
8.2.00.0000.00717.98
8.1.280.0110.00325.92
8.1.270.0070.00023.83
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00922.16
8.1.230.0040.00817.46
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.10
8.1.190.0040.00417.00
8.1.180.0000.00818.10
8.1.170.0050.00518.39
8.1.160.0040.00418.98
8.1.150.0040.00420.54
8.1.140.0000.00719.50
8.1.130.0000.00718.75
8.1.120.0000.00817.31
8.1.110.0040.00417.22
8.1.100.0000.00717.22
8.1.90.0050.00217.32
8.1.80.0070.00017.31
8.1.70.0030.00317.36
8.1.60.0000.00817.36
8.1.50.0060.00317.46
8.1.40.0090.00017.42
8.1.30.0000.00817.37
8.1.20.0060.00317.53
8.1.10.0070.00017.38
8.1.00.0060.00317.25
8.0.300.0050.00318.77
8.0.290.0000.00716.63
8.0.280.0000.00718.31
8.0.270.0040.00417.09
8.0.260.0030.00316.76
8.0.250.0040.00416.93
8.0.240.0070.00016.75
8.0.230.0060.00316.84
8.0.220.0000.00716.71
8.0.210.0060.00316.79
8.0.200.0060.00016.85
8.0.190.0050.00316.88
8.0.180.0000.00716.77
8.0.170.0000.00716.75
8.0.160.0070.00416.75
8.0.150.0000.00716.69
8.0.140.0000.00816.73
8.0.130.0050.00013.31
8.0.120.0040.00416.78
8.0.110.0030.00316.86
8.0.100.0030.00416.84
8.0.90.0030.00316.66
8.0.80.0120.00416.80
8.0.70.0060.00316.70
8.0.60.0000.00716.65
8.0.50.0030.00516.87
8.0.30.0070.01016.89
8.0.20.0100.00917.40
8.0.10.0050.00216.83
8.0.00.0060.01216.57
7.4.330.0050.00015.55
7.4.320.0070.00016.38
7.4.300.0030.00316.45
7.4.290.0030.00716.48
7.4.280.0030.00616.26
7.4.270.0080.00016.47
7.4.260.0060.00013.03
7.4.250.0000.00716.43
7.4.240.0030.00316.44
7.4.230.0070.00016.57
7.4.220.0070.01116.48
7.4.210.0110.00316.45
7.4.200.0050.00316.21
7.4.160.0110.00516.34
7.4.150.0100.01017.40
7.4.140.0100.01017.86
7.4.130.0130.00516.51
7.4.120.0120.00816.36
7.4.110.0130.00716.53
7.4.100.0070.01116.49
7.4.90.0150.00316.22
7.4.80.0070.01319.39
7.4.70.0070.01116.38
7.4.60.0090.00916.20
7.4.50.0090.00616.32
7.4.40.0120.00516.45
7.4.30.0070.01016.49
7.4.10.0100.00714.79
7.4.00.0070.01014.98
7.3.330.0070.00013.03
7.3.320.0000.00613.12
7.3.310.0040.00416.19
7.3.300.0000.00716.20
7.3.290.0050.01016.21
7.3.280.0080.00816.18
7.3.270.0090.00817.40
7.3.260.0110.00516.44
7.3.250.0110.01016.29
7.3.240.0130.00316.28
7.3.230.0070.01016.36
7.3.210.0030.01416.38
7.3.200.0120.00416.20
7.3.190.0110.00616.25
7.3.180.0080.00816.27
7.3.170.0030.01316.40
7.3.160.0060.01516.15
7.3.130.0100.01014.82
7.3.120.0080.00814.62
7.3.110.0150.00314.70
7.3.100.0090.00614.62
7.3.90.0060.00614.66
7.3.80.0080.00814.72
7.3.70.0050.00514.79
7.3.60.0040.00414.76
7.3.50.0080.00414.41
7.3.40.0040.00414.58
7.3.30.0070.00714.55
7.3.20.0080.00816.62
7.3.10.0120.00016.59
7.3.00.0120.00016.59
7.2.330.0090.00916.54
7.2.320.0100.00616.53
7.2.310.0030.01416.24
7.2.300.0060.01316.55
7.2.290.0140.00416.30
7.2.260.0000.01514.91
7.2.250.0060.01314.81
7.2.240.0070.00714.85
7.2.230.0000.01415.04
7.2.220.0030.00714.62
7.2.210.0030.01014.61
7.2.200.0030.01014.77
7.2.190.0000.01214.66
7.2.180.0000.01015.04
7.2.170.0090.00314.77
7.2.160.0070.00714.71
7.2.150.0030.01316.46
7.2.140.0040.01116.55
7.2.130.0060.00316.58
7.2.120.0070.00716.62
7.2.110.0080.00416.47
7.2.100.0110.00716.79
7.2.90.0060.00316.87
7.2.80.0080.00416.71
7.2.70.0000.01716.84
7.2.60.0100.00416.71
7.2.50.0000.01116.61
7.2.40.0060.00916.93
7.2.30.0070.00716.64
7.2.20.0040.00716.64
7.2.10.0030.01216.62
7.2.00.0070.00618.01
7.1.330.0060.00615.81
7.1.320.0060.00615.50
7.1.310.0120.00015.82
7.1.300.0040.01115.81
7.1.290.0030.00615.65
7.1.280.0100.00315.80
7.1.270.0120.00615.70
7.1.260.0000.01115.77
7.1.250.0030.01015.80
7.1.240.0030.00916.00
7.1.230.0060.00315.86
7.1.220.0060.01015.73
7.1.210.0100.00715.68
7.1.200.0030.00615.56
7.1.190.0070.00715.83
7.1.180.0030.00715.82
7.1.170.0060.00615.63
7.1.160.0030.00915.58
7.1.150.0030.00615.86
7.1.140.0060.00915.79
7.1.130.0030.00916.04
7.1.120.0070.00715.78
7.1.110.0040.01115.64
7.1.100.0000.01117.02
7.1.90.0090.00615.93
7.1.80.0000.01215.83
7.1.70.1550.00715.41
7.1.60.0460.01024.59
7.1.50.1580.00924.48
7.1.40.1120.01124.22
7.1.30.1400.01224.20
7.1.20.1130.01024.17
7.1.10.1190.00815.15
7.1.00.0780.01115.46
7.0.330.0000.01415.38
7.0.320.0100.00315.10
7.0.310.0090.00315.20
7.0.300.0070.00315.36
7.0.290.0060.01215.29
7.0.280.0080.00615.21
7.0.270.0060.00315.39
7.0.260.0100.00015.42
7.0.250.0000.01315.04
7.0.240.0030.01015.43
7.0.230.0100.00315.47
7.0.220.0040.00715.68
7.0.210.0100.00015.42
7.0.200.0600.01215.10
7.0.190.1720.00715.25
7.0.180.1190.00714.99
7.0.170.1690.00814.95
7.0.160.1280.00814.91
7.0.150.1030.01314.74
7.0.140.0720.01214.96
7.0.130.0650.01214.80
7.0.120.0760.01115.17
7.0.110.0670.01414.69
7.0.100.0670.01315.00
7.0.90.0760.01114.95
7.0.80.0940.00715.08
7.0.70.0080.01115.04
7.0.60.0610.00614.71
7.0.50.1120.01215.15
7.0.40.0750.00514.09
7.0.30.0730.00513.98
7.0.20.1120.00714.04
7.0.10.1230.01013.99
7.0.00.1020.01014.01
5.6.400.0060.01014.49
5.6.390.0000.01514.31
5.6.380.0070.01014.48
5.6.370.0060.00914.40
5.6.360.0100.00314.50
5.6.350.0080.00814.55
5.6.340.0060.01214.35
5.6.330.0060.00314.52
5.6.320.0060.00614.80
5.6.310.0040.00814.55
5.6.300.0030.01314.39
5.6.290.0000.00914.21
5.6.280.0070.01014.22
5.6.270.0000.01414.43
5.6.260.0070.01114.34
5.6.250.0070.00714.14
5.6.240.0050.00814.39
5.6.230.0070.00814.48
5.6.220.0000.01514.33
5.6.210.0090.00314.43
5.6.200.0070.00314.49
5.6.190.0040.00814.34
5.6.180.0110.00414.53
5.6.170.0060.00914.32
5.6.160.0070.01014.32
5.6.150.0060.00914.28
5.6.140.0030.01014.52
5.6.130.0070.01014.21
5.6.120.0120.00014.69
5.6.110.0030.00614.20
5.6.100.0090.00014.50
5.6.90.0070.01014.26
5.6.80.0070.01014.22
5.6.70.0060.00614.41
5.6.60.0040.01214.19
5.6.50.0030.01014.29
5.6.40.0130.00314.41
5.6.30.0090.00614.23
5.6.20.0040.01114.13
5.6.10.0040.01114.16
5.6.00.0040.01114.21

preferences:
49.11 ms | 401 KiB | 5 Q