php internals - why is this valid PHP code -



php internals - why is this valid PHP code -

put php interpreter , won't show errors. doesn't right me. can shed lite on why works? i'm looking insight on lexer/parser.

<?php -01;[];[];[];4;[[-1]];

although code seems have proper syntax, doesn't is.

there lack of line-breaks, looks jumbled together, does have proper syntax semi-colons @ end of each statement.

if rewrite code more legible, this:

-01; // negative number meaningless 0 padded in front end of it. []; // empty array isn't assigned variable, hence useless; []; // same []; // same 4; // again, number isn't assigned variable nor expression. [[-1]]; // multi-dimensional array -1 inner arrays value, isn't assigned either.

valid code, useless.

php php-internals

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -