3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $basePath = "images/bin/channels/"; $noImageNegative = "images/bin/channels/nochan_neg.png"; $noImageTribune = "http://aiotv.tmsimg.com/sources/generic/generic_sources_h3.png"; $path = "http://aiotv.tmsimg.com/sources/h3/NowShowing/21633/s21633_h3_aa.png"; if($path == $noImageTribune){ $newPath = $noImageNegative; } else { $fileName = pathinfo($path,PATHINFO_FILENAME); $negName = $fileName . "_neg.png"; $newPath = $basePath . $negName; } print $newPath;
based on tDEHq
Output for 5.2.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
images/bin/channels/s21633_h3_aa_neg.png
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.1.6
Notice: Use of undefined constant PATHINFO_FILENAME - assumed 'PATHINFO_FILENAME' in /in/EC8eD on line 9 Warning: pathinfo() expects parameter 2 to be long, string given in /in/EC8eD on line 9 images/bin/channels/_neg.png