3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __toString(): string { return "foo@example.com"; } } $val = new Foo(); var_dump(filter_var($val, FILTER_VALIDATE_EMAIL)); var_dump($val);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2mpMA
function name:  (null)
number of ops:  15
compiled vars:  !0 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'foo'
   11     1        NEW                                                  $1      'Foo'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   12     4        INIT_FCALL                                                   'var_dump'
          5        INIT_FCALL                                                   'filter_var'
          6        SEND_VAR                                                     !0
          7        SEND_VAL                                                     274
          8        DO_ICALL                                             $4      
          9        SEND_VAR                                                     $4
         10        DO_ICALL                                                     
   14    11        INIT_FCALL                                                   'var_dump'
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                                     
         14      > RETURN                                                       1

Class Foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2mpMA
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                       'foo%40example.com'
    8     1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.98 ms | 2144 KiB | 15 Q