3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('LANGUAGE_NONE', 'und'); $node = new stdClass(); $node->type = 'tv_show'; if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE]) && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) { echo "1st check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n"; } else { echo "1st check: field_show_type is empty\n"; } if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) { echo "2nd check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n" } else { echo "2nd check: field_show_type is empty\n"; } $node->field_show_type[LANGUAGE_NONE][0]['value'] = 'test'; if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE]) && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) { echo "1st check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n"; } else { echo "1st check: field_show_type is empty\n"; } if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) { echo "2nd check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n" } else { echo "2nd check: field_show_type is empty\n"; }
based on 08NCa
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.31
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/jpPAQ on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '}', expecting ',' or ';' in /in/jpPAQ on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/jpPAQ on line 16
Process exited with code 255.