3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Book { public $title = ""; public $author = ""; public $yearofpublication = ""; } $book = new Book(); $book->title = "JSF Cookbook"; $book->author = "Anghel Leonard"; $book->yearofpublication="2012"; $result = json_encode($book); echo 'The JSON representation is:'.$result.'<br>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M0gd4
function name:  (null)
number of ops:  18
compiled vars:  !0 = $book, !1 = $result
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   9     1        NEW                                              $3      :-5
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $3
  10     4        ASSIGN_OBJ                                               !0, 'title'
         5        OP_DATA                                                  'JSF+Cookbook'
  11     6        ASSIGN_OBJ                                               !0, 'author'
         7        OP_DATA                                                  'Anghel+Leonard'
  12     8        ASSIGN_OBJ                                               !0, 'yearofpublication'
         9        OP_DATA                                                  '2012'
  14    10        INIT_FCALL                                               'json_encode'
        11        SEND_VAR                                                 !0
        12        DO_ICALL                                         $9      
        13        ASSIGN                                                   !1, $9
  15    14        CONCAT                                           ~11     'The+JSON+representation+is%3A', !1
        15        CONCAT                                           ~12     ~11, '%3Cbr%3E'
        16        ECHO                                                     ~12
        17      > RETURN                                                   1

Class Book: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.3.0