3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar; class Baz { public function toJson() { print json_encode($this); print json_last_error_msg(); } } $baz = new Baz; $baz->toJson();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MKqWL
function name:  (null)
number of ops:  6
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo%5CBar%5CBaz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_METHOD_CALL                                         !0, 'toJson'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo\Bar\Baz:
Function tojson:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MKqWL
function name:  toJson
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5CBar%5Cjson_encode'
          1        FETCH_THIS                                       $0      
          2        SEND_VAR_EX                                              $0
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
   10     5        INIT_NS_FCALL_BY_NAME                                    'Foo%5CBar%5Cjson_last_error_msg'
          6        DO_FCALL                                      0  $2      
          7        ECHO                                                     $2
   11     8      > RETURN                                                   null

End of function tojson

End of class Foo\Bar\Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.92 ms | 1395 KiB | 17 Q