3v4l.org

run code in 300+ PHP versions simultaneously
<?php $isUserAuthorized = true; $siteAddress = 'sute.ru/'; class a { function getSources(){ return array('1'); } function getLink(){ return 'link'; } function getTitle(){ return 'title'; } } $art = new a; if ($isUserAuthorized && $art->getSources()|count > 0){ $color = "#999999"; } else { $color = ""; } $link = "<a href='{$siteAddress}{$art->getLink()}' style='color: $color'>{$art->getTitle()}</a>"; echo $link;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
Fatal error: Uncaught Error: Undefined constant "count" in /in/se50g:17 Stack trace: #0 {main} thrown in /in/se50g on line 17
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant count - assumed 'count' (this will throw an Error in a future version of PHP) in /in/se50g on line 17 <a href='sute.ru/link' style='color: #999999'>title</a>
Output for 5.6.0 - 5.6.24, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
Notice: Use of undefined constant count - assumed 'count' in /in/se50g on line 17 <a href='sute.ru/link' style='color: #999999'>title</a>

preferences:
92.8 ms | 409 KiB | 5 Q