3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Error! class Test { public function foo() { $file = '/tmp/bar'; touch($file); $files = [ realpath($file) ]; var_dump($files); var_dump(array_unique($files)); return array_unique($files); } } var_dump((new Test())->foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0vjW
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'Test'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'foo'
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0vjW
function name:  foo
number of ops:  23
compiled vars:  !0 = $file, !1 = $files
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                       !0, '%2Ftmp%2Fbar'
   10     1        INIT_FCALL                                                   'touch'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
   13     4        INIT_FCALL                                                   'realpath'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $4      
          7        INIT_ARRAY                                           ~5      $4
   12     8        ASSIGN                                                       !1, ~5
   15     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                                     
   16    12        INIT_FCALL                                                   'var_dump'
         13        INIT_FCALL                                                   'array_unique'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                             $8      
         16        SEND_VAR                                                     $8
         17        DO_ICALL                                                     
   18    18        INIT_FCALL                                                   'array_unique'
         19        SEND_VAR                                                     !1
         20        DO_ICALL                                             $10     
         21      > RETURN                                                       $10
   19    22*     > RETURN                                                       null

End of function foo

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.23 ms | 3422 KiB | 17 Q