3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "categories":{ "sermons":[ { "title":"We Have Overcome the World" , "url":"http://test.solidrockchristianfellowship.com/sermons/we-have-overcome-the-world/" , "content":"" , "date":"May 22, 2014", "datetime":"2014-05-22T13:41:49", } ], "events":[ { "title":"SRCF Night of Prayer" , "url":"http://test.solidrockchristianfellowship.com/events/srcf-night-of-prayer/" , "content":"<p>Apr 4th at 7:30 pm SRCF Night of Prayer, Praise and the Word; Guest Speaker is Pastor Shirley Reid; Shekinah Glory Ministry; N. Charleston, SC</p>" , "date":"April 04, 2014", "datetime":"2014-04-04T00:00:00", }, { "title":"Mighty Warrior" , "url":"http://test.solidrockchristianfellowship.com/events/mighty-warrior/" , "content":"" , "date":"April 19, 2014", "datetime":"2014-04-19T00:00:00", }, { "title":"Solid Rock Spring Revival" , "url":"http://test.solidrockchristianfellowship.com/events/solid-rock-spring-revival/" , "content":"<p>SRCF Spring Revival; Guest Speaker is Apostle W. Lenard King; Pastor of New Covenant Evangelistic Center; Charleston, SC</p>" , "date":"April 23, 2014", "datetime":"2014-04-23T00:00:00", } ] }, "pages":{ "About Us": { "title":"About Us" , "url":"http://test.solidrockchristianfellowship.com/about-us/" }, "Bible Study with Pastor Faden": { "title":"Bible Study with Pastor Faden" , "url":"http://test.solidrockchristianfellowship.com/bible-study-with-pastor-faden/" }, "Live Stream": { "title":"Live Stream" , "url":"http://test.solidrockchristianfellowship.com/live-stream/" }, "Our Ministries": { "title":"Our Ministries" , "url":"http://test.solidrockchristianfellowship.com/our-ministries/" }, "Our Mission": { "title":"Our Mission" , "url":"http://test.solidrockchristianfellowship.com/our-mission/" }, "Our Pastor": { "title":"Our Pastor" , "url":"http://test.solidrockchristianfellowship.com/our-pastor/" }, "Our Vision": { "title":"Our Vision" , "url":"http://test.solidrockchristianfellowship.com/our-vision/" }, "Prayer Request": { "title":"Prayer Request" , "url":"http://test.solidrockchristianfellowship.com/prayer-request/" }, "Service Times": { "title":"Service Times" , "url":"http://test.solidrockchristianfellowship.com/service-times/" }, "Subscribe": { "title":"Subscribe" , "url":"http://test.solidrockchristianfellowship.com/subscribe/" }, "Videos": { "title":"Videos" , "url":"http://test.solidrockchristianfellowship.com/videos/" }, "What we Believe": { "title":"What we Believe" , "url":"http://test.solidrockchristianfellowship.com/what-we-believe/" } } } '; function test($jsondata){ // decode the json data for parsing $json = json_decode($jsondata, true); $todaysDate = date("Y-m-d"); $data = $json['categories']['events'] ; foreach($data as $event) { echo '<li>'; echo $event['title']; echo $event['date']; echo $event['datetime']; echo '</li>'; } } ?> <pre><?php var_dump(test($json));?></pre>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uOchK
function name:  (null)
number of ops:  10
compiled vars:  !0 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A%0A%22categories%22%3A%7B%0A%0A%09%22sermons%22%3A%5B%0A%09%09%7B%0A%09%22title%22%3A%22We+Have+Overcome+the+World%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fsermons%2Fwe-have-overcome-the-world%2F%22+%2C%0A%09%22content%22%3A%22%22+%2C%0A%09%22date%22%3A%22May+22%2C+2014%22%2C%0A%09%22datetime%22%3A%222014-05-22T13%3A41%3A49%22%2C%0A%09%09%7D%09%5D%2C%09%0A%0A%09%22events%22%3A%5B%0A%09%09%7B%0A%09%22title%22%3A%22SRCF+Night+of+Prayer%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fevents%2Fsrcf-night-of-prayer%2F%22+%2C%0A%09%22content%22%3A%22%3Cp%3EApr+4th+at+7%3A30+pm+++SRCF+Night+of+Prayer%2C+Praise+and+the+Word%3B+Guest+Speaker+is+Pastor+Shirley+Reid%3B+Shekinah+Glory+Ministry%3B+N.+Charleston%2C+SC%3C%2Fp%3E%22+%2C%0A%09%22date%22%3A%22April+04%2C+2014%22%2C%0A%09%22datetime%22%3A%222014-04-04T00%3A00%3A00%22%2C%0A%09%09%7D%2C%09%09%7B%0A%09%22title%22%3A%22Mighty+Warrior%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fevents%2Fmighty-warrior%2F%22+%2C%0A%09%22content%22%3A%22%22+%2C%0A%09%22date%22%3A%22April+19%2C+2014%22%2C%0A%09%22datetime%22%3A%222014-04-19T00%3A00%3A00%22%2C%0A%09%09%7D%2C%09%09%7B%0A%09%22title%22%3A%22Solid+Rock+Spring+Revival%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fevents%2Fsolid-rock-spring-revival%2F%22+%2C%0A%09%22content%22%3A%22%3Cp%3ESRCF+Spring+Revival%3B+Guest+Speaker+is+Apostle+W.+Lenard+King%3B+Pastor+of+New+Covenant+Evangelistic+Center%3B+Charleston%2C+SC%3C%2Fp%3E%22+%2C%0A%09%22date%22%3A%22April+23%2C+2014%22%2C%0A%09%22datetime%22%3A%222014-04-23T00%3A00%3A00%22%2C%0A%09%09%7D%09%5D%09%0A%09%09%0A%09%7D%2C%0A%0A%22pages%22%3A%7B%0A%09%22About+Us%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22About+Us%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fabout-us%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Bible+Study+with+Pastor+Faden%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Bible+Study+with+Pastor+Faden%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fbible-study-with-pastor-faden%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Live+Stream%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Live+Stream%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Flive-stream%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Our+Ministries%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Our+Ministries%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Four-ministries%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Our+Mission%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Our+Mission%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Four-mission%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Our+Pastor%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Our+Pastor%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Four-pastor%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Our+Vision%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Our+Vision%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Four-vision%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Prayer+Request%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Prayer+Request%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fprayer-request%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Service+Times%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Service+Times%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fservice-times%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Subscribe%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Subscribe%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fsubscribe%2F%22%0A%09%09%7D%2C%09%09%0A%09%22Videos%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22Videos%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fvideos%2F%22%0A%09%09%7D%2C%09%09%0A%09%22What+we+Believe%22%3A%0A%09%09%7B%0A%09%22title%22%3A%22What+we+Believe%22+%2C%0A%09%22url%22%3A%22http%3A%2F%2Ftest.solidrockchristianfellowship.com%2Fwhat-we-believe%2F%22%0A%09%09%7D%09%09%0A%7D%0A%7D%0A'
  120     1        ECHO                                                     '%3Cpre%3E'
          2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'test'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8        ECHO                                                     '%3C%2Fpre%3E'
          9      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/uOchK
function name:  test
number of ops:  26
compiled vars:  !0 = $jsondata, !1 = $json, !2 = $todaysDate, !3 = $data, !4 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  104     0  E >   RECV                                             !0      
  106     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
  107     6        INIT_FCALL                                               'date'
          7        SEND_VAL                                                 'Y-m-d'
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
  108    10        FETCH_DIM_R                                      ~9      !1, 'categories'
         11        FETCH_DIM_R                                      ~10     ~9, 'events'
         12        ASSIGN                                                   !3, ~10
  110    13      > FE_RESET_R                                       $12     !3, ->24
         14    > > FE_FETCH_R                                               $12, !4, ->24
  111    15    >   ECHO                                                     '%3Cli%3E'
  112    16        FETCH_DIM_R                                      ~13     !4, 'title'
         17        ECHO                                                     ~13
  113    18        FETCH_DIM_R                                      ~14     !4, 'date'
         19        ECHO                                                     ~14
  114    20        FETCH_DIM_R                                      ~15     !4, 'datetime'
         21        ECHO                                                     ~15
  115    22        ECHO                                                     '%3C%2Fli%3E'
  110    23      > JMP                                                      ->14
         24    >   FE_FREE                                                  $12
  117    25      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1407 KiB | 20 Q