3v4l.org

run code in 500+ PHP versions simultaneously
<?php class C implements JsonSerializable { public function jsonSerialize() { $a = clone($this); echo 1; return $a; } } echo json_encode(new C());

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nRMRj
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                                'c'
   11     1        INIT_FCALL                                                   'json_encode'
          2        NEW                                                  $0      'C'
          3        DO_FCALL                                          0          
          4        SEND_VAR                                                     $0
          5        DO_ICALL                                             $2      
          6        ECHO                                                         $2
          7      > RETURN                                                       1

Class C:
Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nRMRj
function name:  jsonSerialize
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                           ~1      
          1        CLONE                                                ~2      ~1
          2        ASSIGN                                                       !0, ~2
    7     3        ECHO                                                         1
    8     4      > RETURN                                                       !0
    9     5*     > RETURN                                                       null

End of function jsonserialize

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
243.89 ms | 9428 KiB | 14 Q