3v4l.org

run code in 300+ PHP versions simultaneously
<?php $errors = new class { protected $errors = []; function __toString() : string { return EOL . "Problems: ========================" . EOL . EOL . implode(EOL, $this->errors) . EOL ; } function __count() : int { return count($this->errors); } function add(string $error){ $this->errors[] = $error; } function all() : array { $this->errors; } } ; var_dump(count($errors)); var_dump($errors);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VBRIh
function name:  (null)
number of ops:  12
compiled vars:  !0 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
    3     3        ASSIGN                                                   !0, $2
   18     4        INIT_FCALL                                               'var_dump'
          5        COUNT                                            ~5      !0
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                                 
   19     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VBRIh
function name:  __toString
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_CONSTANT                                   ~0      'EOL'
          1        CONCAT                                           ~1      ~0, 'Problems%3A+%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D'
          2        FETCH_CONSTANT                                   ~2      'EOL'
          3        CONCAT                                           ~3      ~1, ~2
          4        FETCH_CONSTANT                                   ~4      'EOL'
          5        CONCAT                                           ~5      ~3, ~4
    9     6        INIT_FCALL                                               'implode'
          7        FETCH_CONSTANT                                   ~6      'EOL'
          8        SEND_VAL                                                 ~6
          9        FETCH_OBJ_R                                      ~7      'errors'
         10        SEND_VAL                                                 ~7
         11        DO_ICALL                                         $8      
         12        CONCAT                                           ~9      ~5, $8
         13        FETCH_CONSTANT                                   ~10     'EOL'
         14        CONCAT                                           ~11     ~9, ~10
         15        VERIFY_RETURN_TYPE                                       ~11
         16      > RETURN                                                   ~11
   11    17*       VERIFY_RETURN_TYPE                                       
         18*     > RETURN                                                   null

End of function __tostring

Function __count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VBRIh
function name:  __count
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'errors'
          1        COUNT                                            ~1      ~0
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
          4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __count

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VBRIh
function name:  add
number of ops:  5
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        FETCH_OBJ_W                                      $1      'errors'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
          4      > RETURN                                                   null

End of function add

Function all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VBRIh
function name:  all
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'errors'
          1        FREE                                                     ~0
          2        VERIFY_RETURN_TYPE                                       
          3      > RETURN                                                   null

End of function all

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.73 ms | 1400 KiB | 17 Q