3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Email implements JsonSerializable { private $value; public function __construct(string $value) { $email = filter_var($value, FILTER_VALIDATE_EMAIL); if (false === $email) { throw new Exception('Email is invalid.'); } $this->value = $email; } public function jsonSerialize() { return $this->value; } } $email = new Email('opexus@gmail'); echo json_encode(compact('email'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L4Oad
function name:  (null)
number of ops:  13
compiled vars:  !0 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'email'
   21     1        NEW                                              $1      'Email'
          2        SEND_VAL_EX                                              'opexus%40gmail'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   22     5        INIT_FCALL                                               'json_encode'
          6        INIT_FCALL                                               'compact'
          7        SEND_VAL                                                 'email'
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                         $5      
         11        ECHO                                                     $5
         12      > RETURN                                                   1

Class Email:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L4Oad
function name:  __construct
number of ops:  15
compiled vars:  !0 = $value, !1 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 274
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !1, $2
    9     6        TYPE_CHECK                                    4          !1
          7      > JMPZ                                                     ~4, ->12
   10     8    >   NEW                                              $5      'Exception'
          9        SEND_VAL_EX                                              'Email+is+invalid.'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $5
   12    12    >   ASSIGN_OBJ                                               'value'
         13        OP_DATA                                                  !1
   13    14      > RETURN                                                   null

End of function __construct

Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L4Oad
function name:  jsonSerialize
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function jsonserialize

End of class Email.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.96 ms | 1396 KiB | 19 Q