3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { /** * @return bool */ public function sort() { /** @var string[] $result */ $result = array('aaa', 'bbb', 'ccc'); usort($result, array($this, 'sortInternal')); return $result; } /** * @param string $a * @param string $b * @return int */ private function sortInternal($a, $b) {return strcmp($a, $b);} } $b = new B(); echo print_r($b->sort(), true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/khmlf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_FCALL                                               'print_r'
          4        INIT_METHOD_CALL                                         !0, 'sort'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

Class B:
Function sort:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/khmlf
function name:  sort
number of ops:  10
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        FETCH_THIS                                       ~2      
          4        INIT_ARRAY                                       ~3      ~2
          5        ADD_ARRAY_ELEMENT                                ~3      'sortInternal'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   10     8      > RETURN                                                   !0
   11     9*     > RETURN                                                   null

End of function sort

Function sortinternal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/khmlf
function name:  sortInternal
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'strcmp'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of function sortinternal

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.96 ms | 1396 KiB | 19 Q