note 119805 added to generator.throw

From: Date: Tue, 30 Aug 2016 09:31:26 +0000
Subject: note 119805 added to generator.throw
Groups: php.notes 
Request: Send a blank email to php-notes+get-206419@lists.php.net to get a copy of this message
there have errors the form correct to do that is of this way: function gen() { echo "Foo\n"; try { throw new Exception('Prueba'); } catch (Exception $e) { echo "Excepción: {$e->getMessage()}\n"; } echo "Bar\n"; } gen(); i resolved one tecnic of how work getMessage look at it: $myarray=array(); if($respuesta == "Mark"){ for($i=5;$i<=16;$i++){ try { $palabra="soy la excepcion en la linea:".$i; throw new Exception($palabra); } catch(Exception $e) { $myarray[$e->getLine()] =$palabra; if($e->getLine() == $i){ echo "<br><b>La excepción se creó en la línea : " .$e->getLine()."LA LINEA DICE:". $myarray[$e->getLine()]."</b>"; }//if }//catch }//for }//if ---- Server IP: 72.52.91.14 Probable Submitter: 89.7.36.90 ---- Manual Page -- http://php.net/manual/en/generator.throw.php Edit -- https://master.php.net/note/edit/119805 Del: integrated -- https://master.php.net/note/delete/119805/integrated Del: useless -- https://master.php.net/note/delete/119805/useless Del: bad code -- https://master.php.net/note/delete/119805/bad+code Del: spam -- https://master.php.net/note/delete/119805/spam Del: non-english -- https://master.php.net/note/delete/119805/non-english Del: in docs -- https://master.php.net/note/delete/119805/in+docs Del: other reasons-- https://master.php.net/note/delete/119805 Reject -- https://master.php.net/note/reject/119805 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206419) next »