3v4l.org

run code in 300+ PHP versions simultaneously
<?php $purchaseCreateAt = '20170421'; $inflowDate = '-00011130'; echo strpos($inflowDate, '-') === 0 ? $purchaseCreateAt : $inflowDate; echo substr($inflowDate,0,1) === '-' ? $purchaseCreateAt : $inflowDate;

preferences:
42.46 ms | 402 KiB | 5 Q