Take this (non) blade script list.blade.php
:
<?php
error_log( print_r( "START" , true ) );
global $i;
for ( $a = 0 ; $a < 3 ; $a++ ) {
$j = @(int)$i;
error_log( print_r( $j , true ) );
echo $j;
$i = $j + 1 ;
}
error_log( print_r( "STOP" , true ) );
The expected result should be 012
but the output is 345
!
If you check your server error logs, you can see this :
START
0
1
2
STOP
START
3
4
5
STOP
Therefore the template is ran a first time without outputting anything and it is ran a second time and the output is then sent.
I use an updated Laravel 4.2 version. It is not really a problem but when each parsed row is requesting heavy computing task, the load time is just X2.
Do you think it is a bug or is it a normal behaviour ?
Is there a way to avoid some executions in the template on the first launch (dry run) ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community