473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ini_set or function?

103 100+
Hi

Just wanted to find out which one is 'better': using ini_set() to change settings or using a function (eg below). By better I mean faster / more secure or balance of the two. The PHP manual doesn't seem to distinguish.

For example I'm looking at either:

Expand|Select|Wrap|Line Numbers
  1. ini_set('date.timezone',...)
  2.  
or
Expand|Select|Wrap|Line Numbers
  1. date_default_timezone_set();
  2.  
Thanks
Apr 9 '08 #1
1 2095
Atli
5,058 Expert 4TB
Hi.

The date_default_timezone_set function validates the timezone before setting it and generates a notice if it is invalid. It will also probably be a little slower, due to the validation, but by such a small margin that it is completely irrelevant.

I imagine that it simply does the validation and then calls the ini_set function, just like you did.

So if you want the validation, use the function. If not, just use ini_set.
May 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: phil_gg04 | last post by:
Dear Javascript Experts, Opera seems to have different ideas about the visibility of Javascript functions than other browsers. For example, if I have this code: if (1==2) { function...
3
by: MBS | last post by:
I checked the official PHP documentation and it makes no mention of "@ini_set" function with the "@" symbol in front of it. The code I'm looking at does have the "at" symbol in front of...
7
by: yawnmoth | last post by:
When running the following code I get a warning: <? ini_set('session.use_cookies',0); ?> random text <? session_start(); ?>
2
by: TJ | last post by:
Hello All, We have a client who is providing Web Hosting Solutions. One of the features include PHP Scripting. For security reasons, we have disabled some PHP Functions including 'ini_set'....
6
by: howa | last post by:
ini_set( "short_open_tag", 1 ); phpinfo(); still showing 'off'
3
by: David | last post by:
I am puzzled, I want to change the upload_max_filesize setting, if I do this with ini_set('upload_max_filesize', 8000000); the upload_max_filesize is not set. However, if I make the change in...
24
by: Paul | last post by:
I am taking over an existing app and having trouble understanding their references. They have encapsulated Pear packages in the directory structure like: /site /site/html/Pear.php...
2
by: mrbog | last post by:
Here's my code: <?php error_reporting(E_ALL); ini_set("display_startup_errors","1"); ini_set("display_errors","1"); wefw wefwef=wefwe
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.