Skip to main content
deleted 103 characters in body
Source Link
iacnats
  • 181
  • 1
  • 7
<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

How to understand this behavior of php interpreter? Thanks.

// following is added on Oct. 21,2013

if i change the code as

<?php
function outLala() {}
?>
  lala
<?php   
{}
?>

the result of this php file is a page with text "lala".

does it mean that the php interpreter will parse the code inside the open and the close tag, and if it finds a function(or something else) is not properly terminated, the interpreter will think the content following the close tag is part of the function?

<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

How to understand this behavior of php interpreter? Thanks.

// following is added on Oct. 21,2013

if i change the code as

<?php
function outLala() {}
?>
  lala
<?php   
{}
?>

the result of this php file is a page with text "lala".

does it mean that the php interpreter will parse the code inside the open and the close tag, and if it finds a function(or something else) is not properly terminated, the interpreter will think the content following the close tag is part of the function?

<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

if i change the code as

<?php
function outLala() {}
?>
  lala
<?php   
{}
?>

the result of this php file is a page with text "lala".

does it mean that the php interpreter will parse the code inside the open and the close tag, and if it finds a function(or something else) is not properly terminated, the interpreter will think the content following the close tag is part of the function?

added 478 characters in body
Source Link
iacnats
  • 181
  • 1
  • 7
<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

How to understand this behavior of php interpreter? Thanks.

// following is added on Oct. 21,2013

if i change the code as

<?php
function outLala() {}
?>
  lala
<?php   
{}
?>

the result of this php file is a page with text "lala".

does it mean that the php interpreter will parse the code inside the open and the close tag, and if it finds a function(or something else) is not properly terminated, the interpreter will think the content following the close tag is part of the function?

<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

How to understand this behavior of php interpreter? Thanks.

<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

How to understand this behavior of php interpreter? Thanks.

// following is added on Oct. 21,2013

if i change the code as

<?php
function outLala() {}
?>
  lala
<?php   
{}
?>

the result of this php file is a page with text "lala".

does it mean that the php interpreter will parse the code inside the open and the close tag, and if it finds a function(or something else) is not properly terminated, the interpreter will think the content following the close tag is part of the function?

Source Link
iacnats
  • 181
  • 1
  • 7

understanding php start & close tags

<?php
function outLala() {
?>
  lala
<?php   
}
?>

the result of this php file is a blank page instead of a page with text "lala".

How to understand this behavior of php interpreter? Thanks.