3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IErrorManager { public function ariseFatal($message); public function ariseWarning($message); public function ariseNotice($message); } interface ILexer { public function tokenize($input); } interface IParser { public function setKeywords(array $keywords); public function parse($input); } interface IParseResult { public function getDefinition(); public function getName(); public function getConstants(); } interface INameValidator { public function validate($name); } interface ICompiler { public function compile($input); } class ErrorManager implements IErrorManager { public function ariseFatal($message) { $this->triggerError($message, E_USER_FATAL); } public function ariseWarning($message) { $this->triggerError($message, E_USER_WARNING); } public function ariseNotice($message) { $this->triggerError($message, E_USER_NOTICE); } private function triggerError($message, $type) { trigger_error((string)$message, (int)$type); } } abstract class CompilerElement { private $errorManager; protected function getErrorManager() { return $this->errorManager; } protected function __construct(IErrorManager $errorManager) { $this->errorManager = $errorManager; } } class Lexer extends CompilerElement implements ILexer { public function tokenize($input) { if (!is_string($input)) { $this->getErrorManager()->ariseFatal(get_class($this).'::parse expects parameter 1 to be string. '.gettype($input).' given.'); } } public function __construct(IErrorManager $errorManager) { parent::__construct($errorManager); } } class Parser extends CompilerElement implements IParser { private $lexer; private $nameValidator; private $keywords = array(); public function setKeywords(array $keywords) { $this->keywords = $keywords; } public function parse($input) { if (!is_string($input)) { $this->getErrorManager()->ariseFatal(get_class($this).'::parse expects parameter 1 to be string. '.gettype($input).' given.'); } $errorManager = $this->getErrorManager(); $input = $this->cleanUp($input); $tokens = $this->lexer->tokenize($input); $result = array(); $currentResult = null; $processingBody = false; reset($tokens); while (($token = key($tokens)) !== false && ($tokenValue = current($tokens)) !== false) { switch ($token) { case 'type' && $processingBody === false: if ($currrentResult !== null || !isset($this->keywords[$tokenValue])) { $errorManager->ariseFatal('Syntax error. Unexpected '.$tokenValue); } $currentResult = new ParseResult($this->keywords[$tokenValue], $errorManager); break; case 'name' && $processingBody === false: // Will this ever happen? if ($currentResult === null) { $errorManager->ariseFatal('Syntax error. Unexpected '.$tokenValue); } $this->nameValidator->validate($name); $currentResult->setName($name); break; case 'start_body': if ($currentResult === null || $currentResult->getName() === null) { $errorManager->ariseFatal('Syntax error. Unexpected '.$tokenValue); } $processingBody = true; break; case 'end_body': if ($currentResult === null || $currentResult->getName() === null || $processingBody === false) { $errorManager->ariseFatal('Syntax error. Unexpected '.$tokenValue); } $result[] = $currentResult; $currentResult = null; $processingBody = false; break; default: if ($processingBody === true && $currentResult !== null) { $value = $tokenValue !== null ? $tokenValie : 0; $currentResult->setItem($token, $value); } else { $errorManager->ariseFatal('Syntax error. Unexpected '.$tokenValue); } break; } next($tokens); } return $return; } private function cleanUp($input) { return trim($input); } public function __construct(ILexer $lexer, INameValidator $nameValidator, IErrorManager $errorManager) { parent::__construct($errorManager); $this->lexer = $lexer; $this->nameValidator = $nameValidator; } } class ParseResult extends CompilerElement implements IParseResult { private $definition; private $name; private $constants; public function getDefinition() { return $this->definition; } public function getName() { return $this->name; } public function getConstants() { return $this->constants; } public function setItem($name, $value) { if (!is_string($name)) { $this->getErrorManager()->ariseFatal('Enumeration item name can only be string.'); } if (!is_numeric($value)) { $this->getErrorManager()->ariseFatal('Enumeration item can only hold numeric value.'); } $this->constants[$name] = (ctype_digit($value) === false) ? (int)$value : (double)$value; } public function setName($name) { if (!is_string($name)) { $this->getErrorManager()->ariseFatal(get_class($this).'::setName expects parameter 1 to be string. '.gettype($name).' given.'); } $this->name = $name; } public function __construct($definition, IErrorManager $errorManager) { parent::__construct($errorManager); if (!is_string($definition)) { $this->getErrorManager()->ariseFatal(get_class($this).'::__construct expects parameter 1 to be string. '.gettype($definition).' given.'); } $this->definition = $definition; } } class NameValidator extends CompilerElement implements INameValidator { private $allowedChars; public function validate($name) { if (!is_string($name)) { $this->gerErrorManager()->ariseFatal(get_class($this).'::validate expects parameter 1 to be string. '.gettype($name).' given.'); } $nameLength = strlen($name); for ($i = 0; $i < $nameLength; $i++) { $current = $name[$i]; if ($i === 0 && !ctype_alpha($current)) { $this->gerErrorManager()->ariseFatal('Name should start with alphabetic characters. Given name '.$name.' starts with: '.$current); } if (!in_array($current, $this->allowedChars, true)) { $this->gerErrorManager()->ariseFatal('Unexpected character '.$current.' in name '.$name.'.'); } } } public function __construct(IErrorManager $errorManager) { parent::__construct($errorManager); // Yes, I hate that everything is allowed as name in php. $this->allowedChars = str_split('abcdefghijklmnopqrstuvwxyz0123456789'); } } class Enum2PhpCompiler implements ICompiler { private $parser; const INTENDATION_CHAR = "\t"; public function compile($input) { $parseResult = $this->parser->parse($input); $return = $parseResult->getDefinition().' '.$parseResult->getName().' {'.PHP_EOL; foreach ($parseResult->getConstants() as $name => $value) { $return .= Compiler::INTENDATION_CHAR.'const '.$name.' = '.$value.PHP_EOL; } $return .= Compiler::INTENDATION_CHAR.'private function __construct() {}'.PHP_EOL; $return .= '}'; return $return; } public function __construct(IParser $parser) { $this->parser = $parser; } } $code = <<<PHP enum MyEnum { Item1, Item2 = 5, Item3 } PHP;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  (null)
number of ops:  8
compiled vars:  !0 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   DECLARE_CLASS                                            'errormanager'
   61     1        DECLARE_CLASS                                            'lexer', 'compilerelement'
   73     2        DECLARE_CLASS                                            'parser', 'compilerelement'
  159     3        DECLARE_CLASS                                            'parseresult', 'compilerelement'
  206     4        DECLARE_CLASS                                            'namevalidator', 'compilerelement'
  236     5        DECLARE_CLASS                                            'enum2phpcompiler'
  260     6        ASSIGN                                                   !0, '%09enum+MyEnum+%7B%0A%09%09Item1%2C%0A%09%09Item2+%3D+5%2C%0A%09%09Item3%0A%09%7D'
  266     7      > RETURN                                                   1

Class IErrorManager:
Function arisefatal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  ariseFatal
number of ops:  2
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function arisefatal

Function arisewarning:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  ariseWarning
number of ops:  2
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function arisewarning

Function arisenotice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  ariseNotice
number of ops:  2
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function arisenotice

End of class IErrorManager.

Class ILexer:
Function tokenize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  tokenize
number of ops:  2
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function tokenize

End of class ILexer.

Class IParser:
Function setkeywords:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  setKeywords
number of ops:  2
compiled vars:  !0 = $keywords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function setkeywords

Function parse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  parse
number of ops:  2
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function parse

End of class IParser.

Class IParseResult:
Function getdefinition:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  getDefinition
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   null

End of function getdefinition

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  getName
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   null

End of function getname

Function getconstants:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  getConstants
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   null

End of function getconstants

End of class IParseResult.

Class INameValidator:
Function validate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  validate
number of ops:  2
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function validate

End of class INameValidator.

Class ICompiler:
Function compile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  compile
number of ops:  2
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function compile

End of class ICompiler.

Class ErrorManager:
Function arisefatal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  ariseFatal
number of ops:  7
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   33     1        INIT_METHOD_CALL                                         'triggerError'
          2        SEND_VAR_EX                                              !0
          3        FETCH_CONSTANT                                   ~1      'E_USER_FATAL'
          4        SEND_VAL_EX                                              ~1
          5        DO_FCALL                                      0          
   34     6      > RETURN                                                   null

End of function arisefatal

Function arisewarning:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  ariseWarning
number of ops:  6
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
   37     1        INIT_METHOD_CALL                                         'triggerError'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              512
          4        DO_FCALL                                      0          
   38     5      > RETURN                                                   null

End of function arisewarning

Function arisenotice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  ariseNotice
number of ops:  6
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   41     1        INIT_METHOD_CALL                                         'triggerError'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              1024
          4        DO_FCALL                                      0          
   42     5      > RETURN                                                   null

End of function arisenotice

Function triggererror:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  triggerError
number of ops:  9
compiled vars:  !0 = $message, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   45     2        INIT_FCALL                                               'trigger_error'
          3        CAST                                          6  ~2      !0
          4        SEND_VAL                                                 ~2
          5        CAST                                          4  ~3      !1
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   46     8      > RETURN                                                   null

End of function triggererror

End of class ErrorManager.

Class CompilerElement:
Function geterrormanager:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  getErrorManager
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   FETCH_OBJ_R                                      ~0      'errorManager'
          1      > RETURN                                                   ~0
   54     2*     > RETURN                                                   null

End of function geterrormanager

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  __construct
number of ops:  4
compiled vars:  !0 = $errorManager
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
   57     1        ASSIGN_OBJ                                               'errorManager'
          2        OP_DATA                                                  !0
   58     3      > RETURN                                                   null

End of function __construct

End of class CompilerElement.

Class Lexer:
Function tokenize:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/HpZnB
function name:  tokenize
number of ops:  16
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
   63     1        TYPE_CHECK                                   64  ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->15
   64     4    >   INIT_METHOD_CALL                                         'getErrorManager'
          5        DO_FCALL                                      0  $3      
          6        INIT_METHOD_CALL                                         $3, 'ariseFatal'
          7        FETCH_THIS                                       ~4      
          8        GET_CLASS                                        ~5      ~4
          9        CONCAT                                           ~6      ~5, '%3A%3Aparse+expects+parameter+1+to+be+string.+'
         10        GET_TYPE                                         ~7      !0
         11        CONCAT                                           ~8      ~6, ~7
         12        CONCAT                                           ~9      ~8, '+given.'
         13        SEND_VAL_EX                                              ~9
         14        DO_FCALL                                      0          
   66    15    > > RETURN                                                   null

End of function tokenize

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  __construct
number of ops:  5
compiled vars:  !0 = $errorManager
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   RECV                                             !0      
   69     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   70     4      > RETURN                                                   null

End of function __construct

End of class Lexer.

Class Parser:
Function setkeywords:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpZnB
function name:  setKeywords
number of ops:  4
compiled vars:  !0 = $keywords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV                                             !0      
   79     1        ASSIGN_OBJ                                               'keywords'
          2        OP_DATA                                                  !0
   80     3      > RETURN                                                   null

End of function setkeywords

Function parse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 137
Branch analysis from position: 137
2 jumps found. (Code = 46) Position 1 = 143, Position 2 = 149
Branch analysis from position: 143
2 jumps found. (Code = 44) Position 1 = 150, Position 2 = 34
Branch analysis from position: 150
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 67
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 81
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 94
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 113
Branch analysis from position: 113
2 jumps found. (Code = 46) Position 1 = 115, Position 2 = 117
Branch analysis from position: 115
2 jumps found. (Code = 43) Position 1 = 118, Position 2 = 129
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 120, Position 2 = 122
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
1 jumps found. (Code = 42) Position 1 = 133
Branch analysis from position: 133
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
2 jumps found. (Code = 46) Position 1 = 143, Position 2 = 149
Branch analysis from position: 143
Branch analysis from position: 149
Branch analysis from position: 122
1 jumps found. (Code = 42) Position 1 = 133
Branch analysis from position: 133
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
Branch analysis from position: 117
Branch analysis from position: 94
2 jumps found. (Code = 47) Position 1 = 96, Position 2 = 100
Branch analysis from position: 96
2 jumps found. (Code = 47) Position 1 = 101, Position 2 = 103
Branch analysis from position: 101
2 jumps found. (Code = 43) Position 1 = 104, Position 2 = 108
Branch analysis from position: 104
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
Branch analysis from position: 108
Branch analysis from position: 103
Branch analysis from position: 100
Branch analysis from position: 81
2 jumps found. (Code = 47) Position 1 = 83, Position 2 = 87
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 92
Branch analysis from position: 88
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
Branch analysis from position: 92
Branch analysis from position: 87
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 73
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
Branch analysis from position: 73
Branch analysis from position: 47
2 jumps found. (Code = 47) Position 1 = 49, Position 2 = 53
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 58
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 134
Branch analysis from position: 134
Branch analysis from position: 58
Branch analysis from position: 53
Branch analysis from position: 149
Branch analysis from position: 15
filename:       /in/HpZnB
function name:  parse
number of ops:  152
compiled vars:  !0 = $input, !1 = $errorManager, !2 = $tokens, !3 = $result, !4 = $currentResult, !5 = $processingBody, !6 = $token, !7 = $currrentResult, !8 = $tokenValue, !9 = $name, !10 = $value, !11 = $tokenValie, !12 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   82     0  E >   RECV                                             !0      
   83     1        TYPE_CHECK                                   64  ~13     !0
          2        BOOL_NOT                                         ~14     ~13
          3      > JMPZ                                                     ~14, ->15
   84     4    >   INIT_METHOD_CALL                                         'getErrorManager'
          5        DO_FCALL                                      0  $15     
          6        INIT_METHOD_CALL                                         $15, 'ariseFatal'
          7        FETCH_THIS                                       ~16     
          8        GET_CLASS                                        ~17     ~16
          9        CONCAT                                           ~18     ~17, '%3A%3Aparse+expects+parameter+1+to+be+string.+'
         10        GET_TYPE                                         ~19     !0
         11        CONCAT                                           ~20     ~18, ~19
         12        CONCAT                                           ~21     ~20, '+given.'
         13        SEND_VAL_EX                                              ~21
         14        DO_FCALL                                      0          
   87    15    >   INIT_METHOD_CALL                                         'getErrorManager'
         16        DO_FCALL                                      0  $23     
         17        ASSIGN                                                   !1, $23
   88    18        INIT_METHOD_CALL                                         'cleanUp'
         19        SEND_VAR_EX                                              !0
         20        DO_FCALL                                      0  $25     
         21        ASSIGN                                                   !0, $25
   89    22        FETCH_OBJ_R                                      ~27     'lexer'
         23        INIT_METHOD_CALL                                         ~27, 'tokenize'
         24        SEND_VAR_EX                                              !0
         25        DO_FCALL                                      0  $28     
         26        ASSIGN                                                   !2, $28
   91    27        ASSIGN                                                   !3, <array>
   92    28        ASSIGN                                                   !4, null
   93    29        ASSIGN                                                   !5, <false>
   95    30        INIT_FCALL                                               'reset'
         31        SEND_REF                                                 !2
         32        DO_ICALL                                                 
   96    33      > JMP                                                      ->137
   97    34    >   TYPE_CHECK                                    4  ~35     !5
         35        BOOL                                             ~36     ~35
         36        IS_EQUAL                                                 !6, ~36
         37      > JMPNZ                                                    ~34, ->47
  105    38    >   TYPE_CHECK                                    4  ~37     !5
         39        BOOL                                             ~38     ~37
         40        IS_EQUAL                                                 !6, ~38
         41      > JMPNZ                                                    ~34, ->67
  115    42    >   IS_EQUAL                                                 !6, 'start_body'
         43      > JMPNZ                                                    ~34, ->81
  122    44    >   IS_EQUAL                                                 !6, 'end_body'
         45      > JMPNZ                                                    ~34, ->94
         46    > > JMP                                                      ->113
   99    47    >   TYPE_CHECK                                  1020  ~39     !7
         48      > JMPNZ_EX                                         ~39     ~39, ->53
         49    >   FETCH_OBJ_IS                                     ~40     'keywords'
         50        ISSET_ISEMPTY_DIM_OBJ                         0  ~41     ~40, !8
         51        BOOL_NOT                                         ~42     ~41
         52        BOOL                                             ~39     ~42
         53    > > JMPZ                                                     ~39, ->58
  100    54    >   INIT_METHOD_CALL                                         !1, 'ariseFatal'
         55        CONCAT                                           ~43     'Syntax+error.+Unexpected+', !8
         56        SEND_VAL_EX                                              ~43
         57        DO_FCALL                                      0          
  103    58    >   NEW                                              $45     'ParseResult'
         59        CHECK_FUNC_ARG                                           
         60        FETCH_OBJ_FUNC_ARG                               $46     'keywords'
         61        FETCH_DIM_FUNC_ARG                               $47     $46, !8
         62        SEND_FUNC_ARG                                            $47
         63        SEND_VAR_EX                                              !1
         64        DO_FCALL                                      0          
         65        ASSIGN                                                   !4, $45
  104    66      > JMP                                                      ->134
  107    67    >   TYPE_CHECK                                    2          !4
         68      > JMPZ                                                     ~50, ->73
  108    69    >   INIT_METHOD_CALL                                         !1, 'ariseFatal'
         70        CONCAT                                           ~51     'Syntax+error.+Unexpected+', !8
         71        SEND_VAL_EX                                              ~51
         72        DO_FCALL                                      0          
  111    73    >   FETCH_OBJ_R                                      ~53     'nameValidator'
         74        INIT_METHOD_CALL                                         ~53, 'validate'
         75        SEND_VAR_EX                                              !9
         76        DO_FCALL                                      0          
  113    77        INIT_METHOD_CALL                                         !4, 'setName'
         78        SEND_VAR_EX                                              !9
         79        DO_FCALL                                      0          
  114    80      > JMP                                                      ->134
  116    81    >   TYPE_CHECK                                    2  ~56     !4
         82      > JMPNZ_EX                                         ~56     ~56, ->87
         83    >   INIT_METHOD_CALL                                         !4, 'getName'
         84        DO_FCALL                                      0  $57     
         85        TYPE_CHECK                                    2  ~58     $57
         86        BOOL                                             ~56     ~58
         87    > > JMPZ                                                     ~56, ->92
  117    88    >   INIT_METHOD_CALL                                         !1, 'ariseFatal'
         89        CONCAT                                           ~59     'Syntax+error.+Unexpected+', !8
         90        SEND_VAL_EX                                              ~59
         91        DO_FCALL                                      0          
  120    92    >   ASSIGN                                                   !5, <true>
  121    93      > JMP                                                      ->134
  123    94    >   TYPE_CHECK                                    2  ~62     !4
         95      > JMPNZ_EX                                         ~62     ~62, ->100
         96    >   INIT_METHOD_CALL                                         !4, 'getName'
         97        DO_FCALL                                      0  $63     
         98        TYPE_CHECK                                    2  ~64     $63
         99        BOOL                                             ~62     ~64
        100    > > JMPNZ_EX                                         ~62     ~62, ->103
        101    >   TYPE_CHECK                                    4  ~65     !5
        102        BOOL                                             ~62     ~65
        103    > > JMPZ                                                     ~62, ->108
  124   104    >   INIT_METHOD_CALL                                         !1, 'ariseFatal'
        105        CONCAT                                           ~66     'Syntax+error.+Unexpected+', !8
        106        SEND_VAL_EX                                              ~66
        107        DO_FCALL                                      0          
  127   108    >   ASSIGN_DIM                                               !3
        109        OP_DATA                                                  !4
  128   110        ASSIGN                                                   !4, null
  129   111        ASSIGN                                                   !5, <false>
  130   112      > JMP                                                      ->134
  132   113    >   TYPE_CHECK                                    8  ~71     !5
        114      > JMPZ_EX                                          ~71     ~71, ->117
        115    >   TYPE_CHECK                                  1020  ~72     !4
        116        BOOL                                             ~71     ~72
        117    > > JMPZ                                                     ~71, ->129
  133   118    >   TYPE_CHECK                                  1020          !8
        119      > JMPZ                                                     ~73, ->122
        120    >   QM_ASSIGN                                        ~74     !11
        121      > JMP                                                      ->123
        122    >   QM_ASSIGN                                        ~74     0
        123    >   ASSIGN                                                   !10, ~74
  134   124        INIT_METHOD_CALL                                         !4, 'setItem'
        125        SEND_VAR_EX                                              !6
        126        SEND_VAR_EX                                              !10
        127        DO_FCALL                                      0          
        128      > JMP                                                      ->133
  136   129    >   INIT_METHOD_CALL                                         !1, 'ariseFatal'
        130        CONCAT                                           ~77     'Syntax+error.+Unexpected+', !8
        131        SEND_VAL_EX                                              ~77
        132        DO_FCALL                                      0          
  138   133    > > JMP                                                      ->134
  141   134    >   INIT_FCALL                                               'next'
        135        SEND_REF                                                 !2
        136        DO_ICALL                                                 
   96   137    >   INIT_FCALL                                               'key'
        138        SEND_VAR                                                 !2
        139        DO_ICALL                                         $80     
        140        ASSIGN                                           ~81     !6, $80
        141        TYPE_CHECK                                  1018  ~82     ~81
        142      > JMPZ_EX                                          ~82     ~82, ->149
        143    >   INIT_FCALL                                               'current'
        144        SEND_VAR                                                 !2
        145        DO_ICALL                                         $83     
        146        ASSIGN                                           ~84     !8, $83
        147        TYPE_CHECK          

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.28 ms | 1428 KiB | 23 Q