3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Countable { private $prop1, $prop2,$prop3,$prop4; public function allProps(){ return get_object_vars($this); } } $t = new Test; echo count($t->allProps());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TnQmT
function name:  (null)
number of ops:  9
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'test'
    9     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   10     4        INIT_METHOD_CALL                                         !0, 'allProps'
          5        DO_FCALL                                      0  $4      
          6        COUNT                                            ~5      $4
          7        ECHO                                                     ~5
          8      > RETURN                                                   1

Class Test:
Function allprops:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TnQmT
function name:  allProps
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'get_object_vars'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    6     5*     > RETURN                                                   null

End of function allprops

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.58 ms | 1394 KiB | 15 Q