3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $alfabeto = array ('a', 'b'); $estados = array ('q0', 'q1', 'q2', 'q3'); $estInicial = 'q0'; $estadosFinales = array ('q3'); $fTransicion = array(); $fTransicion['q0']['a'] = array ('q0', 'q1'); $fTransicion['q0']['b'] = array ('q0'); $fTransicion['q1']['a'] = array (); $fTransicion['q1']['b'] = array ('q2'); $fTransicion['q2']['a'] = array ('q3'); $fTransicion['q2']['b'] = array (); $fTransicion['q3']['a'] = array ('q3'); $fTransicion['q3']['b'] = array ('q3'); $palabra='aba'; function Evaluar($_palabra,$_fTransicion,$_alfabeto,$_estados){ for ($i=0; $i < count($_estados) ; $i++) { for ($j=0; $j <count($_alfabeto) ; $j++) { echo $_fTransicion[i][j]; } echo ('/n'); } } Evaluar($palabra,$fTransicion,$alfabeto,$estados); ?>
based on i3Y8s
Output for 7.2.0
Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n
Output for 5.3.18 - 7.1.10
Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 Notice: Use of undefined constant i - assumed 'i' in /in/pGIoq on line 30 Notice: Use of undefined constant j - assumed 'j' in /in/pGIoq on line 30 Notice: Undefined index: i in /in/pGIoq on line 30 /n