3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Errors extends ArrayObject {} class Foo { private Errors $errors; public function __construct() { $this->errors = new Errors; } public function generateErrors(): void { $this->errors->append('Test error'); } public function printErrors(): void { foreach($this->errors as $error) { echo $error . PHP_EOL; } } } $foo = new Foo; $foo->generateErrors(); $foo->printErrors();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUks
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   24     3        INIT_METHOD_CALL                                             !0, 'generateErrors'
          4        DO_FCALL                                          0          
   25     5        INIT_METHOD_CALL                                             !0, 'printErrors'
          6        DO_FCALL                                          0          
          7      > RETURN                                                       1

Class Errors: [no user functions]
Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUks
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $1      'Errors'
          1        DO_FCALL                                          0          
          2        ASSIGN_OBJ                                                   'errors'
          3        OP_DATA                                                      $1
   10     4      > RETURN                                                       null

End of function __construct

Function generateerrors:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUks
function name:  generateErrors
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                          ~0      'errors'
          1        INIT_METHOD_CALL                                             ~0, 'append'
          2        SEND_VAL_EX                                                  'Test+error'
          3        DO_FCALL                                          0          
   14     4      > RETURN                                                       null

End of function generateerrors

Function printerrors:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/VvUks
function name:  printErrors
number of ops:  8
compiled vars:  !0 = $error
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                          ~1      'errors'
          1      > FE_RESET_R                                           $2      ~1, ->6
          2    > > FE_FETCH_R                                                   $2, !0, ->6
   18     3    >   CONCAT                                               ~3      !0, '%0A'
          4        ECHO                                                         ~3
   17     5      > JMP                                                          ->2
          6    >   FE_FREE                                                      $2
   20     7      > RETURN                                                       null

End of function printerrors

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.59 ms | 1586 KiB | 13 Q