3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(method_exists(new StdClass, '__toString')); var_dump(method_exists("waa", '__toString')); var_dump(method_exists(array(), '__toString')); var_dump(method_exists(1.337, '__toString')); class A { public function __call($a, $args) { echo $a; } } $a = new A; echo $a->__toString();
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/dOTfL
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_FCALL                                               'var_dump'
         1        INIT_FCALL                                               'method_exists'
         2        NEW                                              $1      :-4
         3        DO_FCALL                                      0          
         4        SEND_VAR                                                 $1
         5        SEND_VAL                                                 '__toString'
         6        DO_ICALL                                         $3      
         7        SEND_VAR                                                 $3
         8        DO_ICALL                                                 
   4     9        INIT_FCALL                                               'var_dump'
        10        INIT_FCALL                                               'method_exists'
        11        SEND_VAL                                                 'waa'
        12        SEND_VAL                                                 '__toString'
        13        DO_ICALL                                         $5      
        14        SEND_VAR                                                 $5
        15        DO_ICALL                                                 
   5    16        INIT_FCALL                                               'var_dump'
        17        INIT_FCALL                                               'method_exists'
        18        SEND_VAL                                                 <array>
        19        SEND_VAL                                                 '__toString'
        20        DO_ICALL                                         $7      
        21        SEND_VAR                                                 $7
        22        DO_ICALL                                                 
   6    23        INIT_FCALL                                               'var_dump'
        24        INIT_FCALL                                               'method_exists'
        25        SEND_VAL                                                 1.337
        26        SEND_VAL                                                 '__toString'
        27        DO_ICALL                                         $9      
        28        SEND_VAR                                                 $9
        29        DO_ICALL                                                 
   8    30        NOP                                                      
  15    31        NEW                                              $12     :11
        32        DO_FCALL                                      0          
        33        ASSIGN                                                   !0, $12
  16    34        INIT_METHOD_CALL                                         !0, '__toString'
        35        DO_FCALL                                      0  $15     
        36        ECHO                                                     $15
        37      > RETURN                                                   1

Class A:
Function __call:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/dOTfL
function name:  __call
number of ops:  4
compiled vars:  !0 = $a, !1 = $args
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  11     2        ECHO                                                     !0
  12     3      > RETURN                                                   null

End of function __call

End of class A.

Generated using Vulcan Logic Dumper, using php 7.2.0