3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fb_username = 'ShuroSan'; $tw_username = 'phishnet'; $fb = @json_decode(file_get_contents('https://graph.facebook.com/'.$fb_username)); $fb_fans = number_format($fb->fan_count); $tw = @json_decode(file_get_contents('http://api.twitter.com/1/users/show.json?screen_name='.$tw_username)); $tw_followers = number_format($tw->followers_count); ?><html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: <?=$fb_fans;?><br /> Twitter follower count: <?=$tw_followers;?><br /> </body> </html>
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Attempt to read property "fan_count" on null in /in/ktclW on line 6 Deprecated: number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /in/ktclW on line 6 Warning: Attempt to read property "followers_count" on null in /in/ktclW on line 9 Deprecated: number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /in/ktclW on line 9 <html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: 0<br /> Twitter follower count: 0<br /> </body> </html>
Output for 8.0.0 - 8.0.30
Warning: Attempt to read property "fan_count" on null in /in/ktclW on line 6 Warning: Attempt to read property "followers_count" on null in /in/ktclW on line 9 <html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: 0<br /> Twitter follower count: 0<br /> </body> </html>
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Trying to get property 'fan_count' of non-object in /in/ktclW on line 6 Notice: Trying to get property 'followers_count' of non-object in /in/ktclW on line 9 <html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: 0<br /> Twitter follower count: 0<br /> </body> </html>
Output for 7.3.32 - 7.3.33, 7.4.26
<html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: 0<br /> Twitter follower count: 0<br /> </body> </html>
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Notice: Trying to get property of non-object in /in/ktclW on line 6 Notice: Trying to get property of non-object in /in/ktclW on line 9 <html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: 0<br /> Twitter follower count: 0<br /> </body> </html>
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Notice: Trying to get property of non-object in /in/ktclW on line 6 Notice: Trying to get property of non-object in /in/ktclW on line 9 <html> <head> <title>Fans and Followers</title> </head> <body> Facebook fan count: <?=$fb_fans;?><br /> Twitter follower count: <?=$tw_followers;?><br /> </body> </html>
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6

Process exited with code 255.
Output for 4.3.0 - 4.3.1

preferences:
330.11 ms | 401 KiB | 456 Q