3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar = 23; public function getBar() { return $this->bar; } public function getBaz() { return mt_rand(); } } $foo = new Foo(); echo sprintf('Testing %s', $foo->getBaz() ?: 'ID#'.$foo->getBar());
Output for 7.4.0
Testing 1691732791
Output for 7.3.12
Testing 1790705474
Output for 7.3.11
Testing 1570836690
Output for 7.3.10
Testing 77422358
Output for 7.3.9
Testing 737941018
Output for 7.3.8
Testing 565108423
Output for 7.3.7
Testing 1736763668
Output for 7.3.6
Testing 1194557873
Output for 7.3.5
Testing 678694598
Output for 7.3.4
Testing 661497089
Output for 7.3.3
Testing 509044295
Output for 7.3.2
Testing 576143239
Output for 7.3.1
Testing 1964534043
Output for 7.3.0
Testing 12009728
Output for 7.2.25
Testing 524395841
Output for 7.2.24
Testing 45358990
Output for 7.2.23
Testing 829579256
Output for 7.2.22
Testing 370295086
Output for 7.2.21
Testing 1847380732
Output for 7.2.20
Testing 265733283
Output for 7.2.19
Testing 142354927
Output for 7.2.18
Testing 1087623178
Output for 7.2.17
Testing 1278343582
Output for 7.2.0
Testing 604290340
Output for 7.1.33
Testing 530441440
Output for 7.1.32
Testing 1840250214
Output for 7.1.31
Testing 1341511654
Output for 7.1.30
Testing 546923451
Output for 7.1.29
Testing 2064780533
Output for 7.1.28
Testing 758227446
Output for 7.1.27
Testing 60233360
Output for 7.1.26
Testing 2121706036
Output for 7.1.7
Testing 195354610
Output for 7.1.6
Testing 1923311227
Output for 7.1.5
Testing 1283618189
Output for 7.1.0
Testing 396961294
Output for 7.0.20
Testing 904057089
Output for 7.0.14
Testing 884593381
Output for 7.0.6
Testing 892732239
Output for 7.0.5
Testing 1675596430
Output for 7.0.4
Testing 305504371
Output for 7.0.3
Testing 1881425634
Output for 7.0.2
Testing 1575493583
Output for 7.0.1
Testing 139882354
Output for 7.0.0
Testing 1613355572
Output for 5.6.28
Testing 1219952133
Output for 5.6.21
Testing 41941898
Output for 5.6.20
Testing 1536730422
Output for 5.6.19
Testing 365841534
Output for 5.6.18
Testing 1316206288
Output for 5.6.17
Testing 654830220
Output for 5.6.16
Testing 878222637
Output for 5.6.15
Testing 1926350509
Output for 5.6.14
Testing 212774855
Output for 5.6.13
Testing 1086543349
Output for 5.6.12
Testing 1081019859
Output for 5.6.11
Testing 2030050343
Output for 5.6.10
Testing 331794467
Output for 5.6.9
Testing 782211916
Output for 5.6.8
Testing 248831797
Output for 5.6.7
Testing 356170488
Output for 5.5.35
Testing 277967680
Output for 5.5.34
Testing 1194672552
Output for 5.5.33
Testing 182529706
Output for 5.5.32
Testing 1489644996
Output for 5.5.31
Testing 374811959
Output for 5.5.30
Testing 1943481343
Output for 5.5.29
Testing 1599754655
Output for 5.5.28
Testing 1614523470
Output for 5.5.27
Testing 941780137
Output for 5.5.26
Testing 139401448
Output for 5.5.25
Testing 1168396626
Output for 5.5.24
Testing 664570453
Output for 5.4.45
Testing 1887429275
Output for 5.4.44
Testing 9955555
Output for 5.4.43
Testing 449901354
Output for 5.4.42
Testing 381909999
Output for 5.4.41
Testing 41271892
Output for 5.4.40
Testing 98461002
Output for 5.4.39
Testing 916858504
Output for 5.4.38
Testing 427075578
Output for 5.4.37
Testing 974220663
Output for 5.4.36
Testing 844247333
Output for 5.4.35
Testing 1580572868
Output for 5.4.34
Testing 1802309767
Output for 5.4.32
Testing 1570359939
Output for 5.4.31
Testing 595501650
Output for 5.4.30
Testing 1160136447
Output for 5.4.29
Testing 1851783805
Output for 5.4.28
Testing 70570183
Output for 5.4.27
Testing 1040677866
Output for 5.4.26
Testing 1917303551
Output for 5.4.25
Testing 1552299481
Output for 5.4.24
Testing 1683808047
Output for 5.4.23
Testing 293982243
Output for 5.4.22
Testing 1078263600
Output for 5.4.21
Testing 546779580
Output for 5.4.20
Testing 1941415734
Output for 5.4.19
Testing 979250851
Output for 5.4.18
Testing 1593380622
Output for 5.4.17
Testing 1247031196
Output for 5.4.16
Testing 827185990
Output for 5.4.15
Testing 180321191
Output for 5.4.14
Testing 14996972
Output for 5.4.13
Testing 234484466
Output for 5.4.12
Testing 999189518
Output for 5.4.11
Testing 794409088
Output for 5.4.10
Testing 1036326960
Output for 5.4.9
Testing 769405014
Output for 5.4.8
Testing 143297840
Output for 5.4.7
Testing 1283473554
Output for 5.4.6
Testing 2061620300
Output for 5.4.5
Testing 1750288807
Output for 5.4.4
Testing 1950207905
Output for 5.4.3
Testing 626343525
Output for 5.4.2
Testing 33200929
Output for 5.4.1
Testing 348981168
Output for 5.4.0
Testing 184520470
Output for 5.3.29
Testing 460902907
Output for 5.3.28
Testing 1984144867
Output for 5.3.27
Testing 674351326
Output for 5.3.26
Testing 2129498150
Output for 5.3.25
Testing 320507451
Output for 5.3.24
Testing 1314682534
Output for 5.3.23
Testing 946315972
Output for 5.3.22
Testing 219571219
Output for 5.3.21
Testing 45137984
Output for 5.3.20
Testing 2118243960
Output for 5.3.19
Testing 1438736057
Output for 5.3.18
Testing 324210523
Output for 5.3.17
Testing 1568599376
Output for 5.3.16
Testing 1843725731
Output for 5.3.15
Testing 1349304034
Output for 5.3.14
Testing 1775293016
Output for 5.3.13
Testing 620973802
Output for 5.3.12
Testing 1935009633
Output for 5.3.11
Testing 1431106366
Output for 5.3.10
Testing 1586495564
Output for 5.3.9
Testing 682267154
Output for 5.3.8
Testing 2008947978
Output for 5.3.7
Testing 1467011800
Output for 5.3.6
Testing 1100348650
Output for 5.3.5
Testing 993176833
Output for 5.3.4
Testing 1110557148
Output for 5.3.3
Testing 1283637691
Output for 5.3.2
Testing 927392445
Output for 5.3.1
Testing 1993936311
Output for 5.3.0
Testing 251183515
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected ':' in /in/2VE5s on line 12
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected ':' in /in/2VE5s on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/2VE5s on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/2VE5s on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/2VE5s on line 5
Process exited with code 255.

preferences:
174.99 ms | 401 KiB | 206 Q