CodeIgniter Forums
PHP 5.3.0 Compatibility - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: PHP 5.3.0 Compatibility (/thread-21042.html)

Pages: 1 2 3 4 5 6


PHP 5.3.0 Compatibility - El Forum - 09-08-2009

[eluser]eightamrock[/eluser]
OSX Snow Leopard ships with PHP 5.3, with this the short_open_tags is turned off by default and no timezone is selected by default. Changing my php.ini solved the short tags and the date() error.

Just my $.02


PHP 5.3.0 Compatibility - El Forum - 09-08-2009

[eluser]jedd[/eluser]
Ah yes .. the 'no new features' release.

Noice.

Anyhoo, short tags are well and truly deprecated - and probably have been since the afternoon they were first touted - so you're probably better off biting the bullet and fixing that mistake properly now rather than continuing to deploy workarounds for them.


PHP 5.3.0 Compatibility - El Forum - 09-08-2009

[eluser]Derek Jones[/eluser]
[quote author="jedd" date="1252469650"]Ah yes .. the 'no new features' release.[/quote]

Actually there are plenty of new features.

Quote:Anyhoo, short tags are well and truly deprecated - and probably have been since the afternoon they were first touted - so you're probably better off biting the bullet and fixing that mistake properly now rather than continuing to deploy workarounds for them.

Short tags aren't deprecated.


PHP 5.3.0 Compatibility - El Forum - 09-09-2009

[eluser]jedd[/eluser]
[quote author="Derek Jones" date="1252478412"]
[quote author="jedd" date="1252469650"]
Ah yes .. the 'no new features' release.[/quote]
Actually there are plenty of new features.
[/quote]

Quite. Hence quotes.

When Bertrand Sertet talked up Snow Leopard at WWDC last year, that was the tagline being used. There's an [url="http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars"]interesting article over at arstechnica[/url] that examines the claim and the history wrapped around it if you're interested in such things.



Quote:Short tags aren't deprecated.

Ah, my mistake. I keep forgetting (wishing?) that when they killed short tags (<%) they also killed the short/echo tag (&lt;?=). I'm sure I read an early paper from the developer love-ins on such an intent, but I guess it's just another item in the list of things they wimped out on.

As you observe, support for &lt;?= is disabled in the shipped php.ini - that, perhaps, hopefully, alludes to 'future direction'.

In any case, your page lacks ambiguity [url="http://ellislab.com/codeigniter/user-guide/general/styleguide.html#short_open_tags"]on the subject of &lt;?= usage[/url]. (And I happily concede, but am eager to ignore, that this is contradicted by [url="http://ellislab.com/codeigniter/user-guide/general/alternative_php.html"]this page[/url]. Wink


PHP 5.3.0 Compatibility - El Forum - 09-09-2009

[eluser]Derek Jones[/eluser]
Oh sorry, jedd, I thought the 'no new features' was in reference to the upcoming CI 1.7.2 release.

We actually encourage short tags in view files, as it promotes readability, particularly for designers with little scripting knowledge, who are likely to have to get their hands inside a view file at some point. CI will rewrite short tags in view files for you if the server doesn't support it. But for redistributable code, you absolutely must avoid short tags in your controllers, models, libraries, etc. since CI cannot rewrite those for you.


PHP 5.3.0 Compatibility - El Forum - 01-14-2010

[eluser]marquex[/eluser]
For fixing the magic_quotes warning, it's better to add

Code:
if(version_compare(PHP_VERSION, '5.3.0', '<'))
   @set_magic_quotes_runtime(0); // Kill magic quotes

This will work no matter how many times your host provider updates the php.

cheers


PHP 5.3.0 Compatibility - El Forum - 01-14-2010

[eluser]Derek Jones[/eluser]
marquex how is that better than the current code?

Code:
if ( ! is_php('5.3'))
{
    @set_magic_quotes_runtime(0); // Kill magic quotes
}



PHP 5.3.0 Compatibility - El Forum - 01-15-2010

[eluser]marquex[/eluser]
When a version 5.4 or 6.0 is released, that code will execute the set_magic_quotes_runtime function again, and we'll be forced to change the code again.

It's better to use the version_compare function.


PHP 5.3.0 Compatibility - El Forum - 01-15-2010

[eluser]marquex[/eluser]
Ey i didn't realized that is_php is using the function version_compare

Forget everything i said, is_php is right, i just didn't know about it.


PHP 5.3.0 Compatibility - El Forum - 01-15-2010

[eluser]Derek Jones[/eluser]
:-D