3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $str; public function __toString() { return $this->str; } } $a = new Foo();$a->str = '111'; $b = new Foo();$b->str = '1b'; $c = new Foo();$b->str = '1A'; $list = [$a, $b, $c]; natcasesort($list); print_r($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/463Uv
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   12     1        NEW                                              $4      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
          4        ASSIGN_OBJ                                               !0, 'str'
          5        OP_DATA                                                  '111'
   13     6        NEW                                              $8      'Foo'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $8
          9        ASSIGN_OBJ                                               !1, 'str'
         10        OP_DATA                                                  '1b'
   14    11        NEW                                              $12     'Foo'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $12
         14        ASSIGN_OBJ                                               !1, 'str'
         15        OP_DATA                                                  '1A'
   16    16        INIT_ARRAY                                       ~16     !0
         17        ADD_ARRAY_ELEMENT                                ~16     !1
         18        ADD_ARRAY_ELEMENT                                ~16     !2
         19        ASSIGN                                                   !3, ~16
   18    20        INIT_FCALL                                               'natcasesort'
         21        SEND_REF                                                 !3
         22        DO_ICALL                                                 
   20    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class Foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/463Uv
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'str'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
    9     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.98 ms | 1396 KiB | 17 Q