3v4l.org

run code in 300+ PHP versions simultaneously
<?php # Globale Funktion function foo( $bar ) { return true; } class Foo { static function instance() { return new Foo(); } # Statische Methode static function bar( $buz ) { return true; } # Instanz Methode function buz( $bee ) { return true; } } # Error Handler setzen um Warnungen zu verkürzen set_error_handler( "err" ); function err( $errno, $errstr ) { echo "{WARNING} "; return true; } # Funktion zum Testen der Aufrufe function test( $method ) { try { eval ( $method ); echo "$method\n"; } catch ( Throwable $e ) { $class = get_class( $e ); echo "[$class] $method\n"; } } # Tests durchführen test('foo();'); test('Foo::bar();'); test('Foo::instance()->buz();'); test('ksort();');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'err'
          2        DO_ICALL                                                 
   53     3        INIT_FCALL                                               'test'
          4        SEND_VAL                                                 'foo%28%29%3B'
          5        DO_FCALL                                      0          
   54     6        INIT_FCALL                                               'test'
          7        SEND_VAL                                                 'Foo%3A%3Abar%28%29%3B'
          8        DO_FCALL                                      0          
   55     9        INIT_FCALL                                               'test'
         10        SEND_VAL                                                 'Foo%3A%3Ainstance%28%29-%3Ebuz%28%29%3B'
         11        DO_FCALL                                      0          
   56    12        INIT_FCALL                                               'test'
         13        SEND_VAL                                                 'ksort%28%29%3B'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  foo
number of ops:  3
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1      > RETURN                                                   <true>
    7     2*     > RETURN                                                   null

End of function foo

Function err:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  err
number of ops:  5
compiled vars:  !0 = $errno, !1 = $errstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   33     2        ECHO                                                     '%7BWARNING%7D+'
   34     3      > RETURN                                                   <true>
   35     4*     > RETURN                                                   null

End of function err

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  test
number of ops:  16
compiled vars:  !0 = $method, !1 = $e, !2 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
   42     1        INCLUDE_OR_EVAL                                          !0, EVAL
   43     2        NOP                                                      
          3        FAST_CONCAT                                      ~4      !0, '%0A'
          4        ECHO                                                     ~4
          5      > JMP                                                      ->15
   45     6  E > > CATCH                                       last         'Throwable'
   47     7    >   GET_CLASS                                        ~5      !1
          8        ASSIGN                                                   !2, ~5
   48     9        ROPE_INIT                                     5  ~8      '%5B'
         10        ROPE_ADD                                      1  ~8      ~8, !2
         11        ROPE_ADD                                      2  ~8      ~8, '%5D+'
         12        ROPE_ADD                                      3  ~8      ~8, !0
         13        ROPE_END                                      4  ~7      ~8, '%0A'
         14        ECHO                                                     ~7
   50    15    > > RETURN                                                   null

End of function test

Class Foo:
Function instance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  instance
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   14     3*     > RETURN                                                   null

End of function instance

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  bar
number of ops:  3
compiled vars:  !0 = $buz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1      > RETURN                                                   <true>
   20     2*     > RETURN                                                   null

End of function bar

Function buz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s51cl
function name:  buz
number of ops:  3
compiled vars:  !0 = $bee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1      > RETURN                                                   <true>
   26     2*     > RETURN                                                   null

End of function buz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
218.42 ms | 1458 KiB | 18 Q