3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TransactionId { private $id; public function __construct($id) { $this->id = $id; } public function __troString() { return $this->id; } } echo json_encode(array('id' => (string) new TransactionId('asdfgbhbva')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H8ZHa
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'json_encode'
          1        NEW                                              $0      'TransactionId'
          2        SEND_VAL_EX                                              'asdfgbhbva'
          3        DO_FCALL                                      0          
          4        CAST                                          6  ~2      $0
          5        INIT_ARRAY                                       ~3      ~2, 'id'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

Class TransactionId:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H8ZHa
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

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

End of function __trostring

End of class TransactionId.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.54 ms | 1400 KiB | 15 Q