3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $field = 'aut.date AS "date_inscription"'; if(strpos($field, 'aut.') === 0) { $_field = explode('.', $field); $aliasSuffix = $_field[1]; if(strpos($field, 'AS')!=-1) { $_aliasSuffix = explode('AS', $_field); $aliasSuffix = str_replace(array('"', "'"), '', trim($_aliasSuffix[1])); } } echo "aliasSuffix=$aliasSuffix";
Output for 5.3.1 - 7.1.0
Warning: explode() expects parameter 2 to be string, array given in /in/AuESj on line 7 aliasSuffix=
Output for 5.3.0
Notice: Array to string conversion in /in/AuESj on line 7 Notice: Undefined offset: 1 in /in/AuESj on line 8 aliasSuffix=
Output for 4.3.0 - 5.2.17
Notice: Array to string conversion in /in/AuESj on line 7 Notice: Undefined offset: 1 in /in/AuESj on line 8 aliasSuffix=