php-general Digest 22 Jul 2010 02:35:11 -0000 Issue 6858

Topics (messages 307063 through 307081):

Re: PDO and UPDATE problem
        307063 by: Peter Lind

ƒÈ|²¿|Éó|Ӌ|Óë|ƒÈ|¿Ø|ïL|ëU|¹Ü|Àí
        307064 by: bftvetq

Question about SQL and Graph nodel trees
        307065 by: Tim Gallagher
        307070 by: Andrew Ballard
        307080 by: Tim Gallagher

Extending Exception
        307066 by: Christoph Boget
        307067 by: Ashley Sheridan
        307068 by: Richard Quadling
        307069 by: Richard Quadling
        307071 by: Richard Quadling

XML DOM
        307072 by: Ben Miller

What are the curly brackets around variables in SQL statements for?
        307073 by: Dotan Cohen
        307074 by: Daniel Brown
        307075 by: Dotan Cohen
        307076 by: Nathan Nobbe
        307077 by: Dotan Cohen
        307078 by: Nathan Nobbe
        307079 by: Daniel Brown

Re: php array in different OS
        307081 by: fyang

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 21 July 2010 15:04, Sky Gunning <sky.gunn...@gmail.com> wrote:
> Hello
>
> I have a problem with a update using PDO.
> (learning atm and updating a php class to use PDO)
>
>    private function updateUser($id)
>    {
>        $date = mktime();
>
>        $DB = Db::getInstance();
>
>        $stmt = $DB->prepare('"UPDATE  '. TBL_USERS .' SET
> date_last_action=:updateDate WHERE id=:userId');

Try without the extra quotation mark before UPDATE.

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>

--- End Message ---
--- Begin Message ---
下午 10:04:12;ZFWAR3WSDGT4WE633E63XG


         < 内 部 审 计 及 内 部 控 制 与 财 务 风 险 管 理 >

                 时 间:2010年7月29-30日(上 海)
                 时 间:2010年8月06-07日(深 圳)

◆参课对象: 董事会、监事会成员;负责内部控制和内部审计部门的经理
、主管;总经理、财务副总经理以及其他高级经营管理人员;财务总监、财
务经理、财务主管、税务经理、税务主管、总帐会计、税务会计等具体操
作人士。

◆说  明:凡希望参加认证的学员,在课程结束后参加认证考试并合格者,
颁发“香港培训认证中心国际职业资格认证中心HKTCC”《国际注册
财务管理师(内部审计与内部控制管理方向)》职业资格证书。(国际认
证/全球通行/雇主认可/联网查询)。(课程结束10日内快递给学员)。

◇课--程--背--景:
如何确保企业经营的效率和效果?
如何确保企业财务报告的可靠性? 
如何保证企业始终遵守法律法规?
如何保证企业资产的安全?
如何评估与防范财务风险,保证企业永续经营?
如何通过内部审计发现企业经营异常并及时采取有效措施? 
  为了实现上述目标,企业必须建立有效的内部控制体系,有效的内部
控制体系已成为企业可持续发展的关键。改革开放以来中国诸多企业的
兴衰成败也从某个侧面揭示了内部控制与采取风险管理的必要性,特别
是近年来德隆集团、格林柯尔等企业的覆灭,更是凸显其重要性。 

◇讲--师--资--历:
  章老师:(中国唯一纵横“财务、人力资源、管理”三大领域的“三栖”
实战财务专家)中国人民大学MBA,中国注册会计师(CPA)、注册税务师
(CPT),著名实战派财务管理专家与人力资源管理专家。历任江苏油田
江都油脂油品厂财务主管、江苏油田化工公司副总经理、扬州大公会计师
事务所首席注册会计师、中美合资上海美通生物科技有限公司首席财务官
兼泰州美通药业有限公司财务总监。精通财务管理咨询及税务策划、资本
运作、企业内部审计及内部控制与财务风险管理制度设计、项目可行性分
析及项目融资、人力资源管理与开发技术等,从管理的角度解读财务,从
财务的角度分析管理,能将专业的财税类课程讲解得通俗易懂且趣味横生
,先后为全国数十家企业提供深度咨询服务,为上百家企业提供企业内训
服务,成功举办过上百场大型公开课。主讲的《内部审计及内部控制与财
务风险管理》、《总经理的财务管理实战高级研修班》、《微利时代打造
企业竞争力的管理利器――全面预算管理与全面成本控制实战》、《企业
经营战略》、《新企业所得税法解读和应对策略及实施后的合法节税技巧
与涉税风险防范》、《税务策划技巧与实务》、《企业中高收入者的薪酬
奖金纳税筹划(避税)》、《税务风险规避与防范》、《房地产企业土地增
值税清算与筹划实务》、《非财务经理的财务管理》、《财务管理沙盘模
拟》、《公共关系与商务礼仪》、《企业营销理念与技巧》、《团队建设
与管理》、《非人力资源经理的人力资源管理》、《打造强势执行力》等
课程深受业内人士好评。接受过章先生培训指导的部分客户有:中国电信
、中国石油、中国石化、扬子江动力、宏福集团、亚星客车、奔驰汽车、
赛德电气、华山光电、恒诚织布、威克生物、星火锻压、红旗电缆、中机
环建、中油天工、正大饲料、广兴达集团、鹰游集团、京江大酒店、万科
房产、德美化工、深圳和立泰集团、珠海威丝曼服饰、安徽古井集团、河
南航空食品、上海三电、江都市发展与改革委员会、台州市经济与贸易委
员会……等上千企业,均受到客户的一致赞扬。
           授课风格:旁征博引,诙谐幽默,深入浅出。 

◇课--程--大--纲:
企业内部审计篇
一、内部审计的基本概念
(一)内部审计的概念
1)概念
2)目的
3)内部审计与外部审计的比较
(二)内部审计的发展阶段
1)控制
2)控制结构
3)企业风险
4)企业风险管理流程
(三)内部审计的角色
1)监督者
2)检察员
3)协助者
4)咨询师
(四)内部审计过程
1)理解期望
2)分析经营状况
3)确认程序与风险
4)分析程序与风险
5)汇报与跟踪
(五)基本审计方法
1)与管理层讨论
2)实地观察
3)审阅书面资料
4)抽样测试

二、内部审计与外部审计共同涉及的几大专业问题
1)审计通知书与审计业务约定书 
2)审计计划
3)重要性与审计风险
4)内外部审计的评价、协调与专家的使用
5)审计抽样
6)审计证据
7)审计工作底稿
8)审计报告
9)审计质量控制

三、内部审计具体准则讲解
1)内部控制审计
2)舞弊的预防检查与报告
3)后续审计
4)内部审计督导
5)结果沟通
6)遵循性审计
7)分析性复核
8)风险管理审计
10)人际关系
11)内部审计的控制自我评估法
12)内部审计机构与董事会或最高管理层的关系
13)内部审计机构的管理
14)经济性审计
15)效果性审计
16)效率性审计 

四、内部审计实施中需要关注的几个问题
1)符合性测试与实质性测试
2)重要性、审计风险与审计抽样
3)不同类型审计的特殊考虑

企业内部控制篇
一、内部控制概论
(一)内部控制的概念
1)内部控制的一般概念
2)COSO报告的定义
3)内部控制的种类
(二)内部控制的属性
1)职责分工
2)实物接触控制
3)内部核查
4)充分的书面记录
5)恰当的授权
(三)内部控制的种类
1)按控制性质分
2)按控制内容分
3)按控制地位分
4)按控制功能分
5)按控制时序分
(四)内部控制的设计原则
1)相互牵制
2)协调配合
3)岗位匹配
4)成本效益
5)整体结构
(五)控制点与控制技巧
1)一般控制点应建立在尽可能接近行动发生之处
2)一般控制技巧
总结:内部控制的局限

二、内部会计控制规范总揽
(一)内部会计控制规范(试行)
1)基本规范
2)货币资金
3)销售与收款
4)采购与付款
5)工程项目
6)担保
7)对外投资 
 (二)内部会计控制规范(征求意见稿)
1)成本费用
2)存货
3)预算
4)固定资产
5)筹资 

三、业务流程重组
(一)流程重组的症状
1)市场份额下降
2)交货期延长
3)竞争能力降低
4)生产率降低
5)客户满意度降低
6)环境剧变
(二)流程重组的步骤及各步骤的操作要点
1)制定重组策略
2)流程设计
3)实施
4)效果评估
(三)流程重组各步骤操作要点(最佳管理实践)
1)了解市场和客户
2)制定愿景和战略
3)设计产品和服务
4)市场营销
5)生产和配送产品及提供服务
6)向客户开票收款及提供服务
7)人力资源管理
8)财务管理
(四)业务流程图
1)业务流程涉及的部门
2)工作内容及步骤
3)部门间的相互关系
4)业务文件
5)业务流程图操作手册示例

四、内部控制实务
(一)常见的舞弊类型
1)虚报冒领
2)阴阳发票
3)无中生有
4)侵吞不报
5)模仿签字
6)假公济私
7)瞒天过海
8)里应外合
9)暗渡陈仓
10)混水摸鱼
11)偷梁换柱
12)张冠李戴
13)监守自盗
(二)内部控制的设计步骤
1)确定控制目标
2)整合控制流程
3)鉴别控制环节
4)确定控制措施
(三)内部控制实例详解
1)货币资金内控设计
2)销售与收款业务内控设计 
3)生产循环内控设计
4)采购与付款业务内控设计 
5)筹资与投资内控设计
6)预算控制制度
7)成本控制规范 
(四)建立内部控制系统必须考虑的重要因素
1)控制环境
2)内部牵制
3)内部审计
4)财务内控

企业财务风险及防范篇
一、财务风险的一般概念、种类、特征及其成因分析 
(一)财务风险的一般概念
1)财务风险的概念
2)财务风险与经营风险的区别
(二)财务风险的种类 
1)筹资风险
2)投资风险
3)资金回收风险
4)收益分配风险。 
(三)财务风险的特征 
1)客观性
2)全面性
3)不确定性
4)激励性
(四)企业财务风险成因分析
1)环境影响
2)资产结构与资本结构不合理
3)财务决策失误
4)管理人员认知偏差

二、财务风险的评估与控制
(一)财务风险的评估(Z-SCORE模型)
(二)财务风险的控制与防范措施
1)分配法
2)回避法 

3)转移法
4)降低法 
---------------------------------------------------------------
★主-办-单-位:中--培--信--息--网

★学-习-费-用: 2600元/人(含指定教材、午餐、茶点费等)

★认-证-费-用:500元/人(不参加认证考试的学员无须交纳此费用)。

★报-名-咨-询:T E L: (0755) 61280152(深 圳)

★报-名-咨-询:T E L: (0 2 1) 51083290(上 海)
---------------------------------------------------------------
                     【报―名―回―执―表】

           F A X:(07 55)61280153 或 (0 2 1) 51083296

我单位共_____人报名参加2010年___月______日在□上海、□深圳举办的:

《内部审计及内部控制与财务风险管理》;

单位名称:_________________________________ 参会人数:_________人 

联系人:____________ 电 话:_____________ 传 真:________________

参会费用 ¥:___________元               邮 件:_______________

参 会 人:_____________________________________________________

付款方式: □1、现金 □2、转帐 

预订项目:□是、□否 住宿(请选择打“√”)

预订项目:□是、□否 参加资格认证(请选择打“√”)

备注:请您把报名回执回传我司,��确保您报名无误,请您再次电话确认!

--- End Message ---
--- Begin Message ---
I cannot be the only one that is having this problem, what are you using for 
DAG (Direct Acrylic Graph)?  I need to have a mesh node edge graph and am 
having trouble with this?  I see that Neo4j has a rest server and I can do this 
in Java but I want to do it in PHP with a MYSQL or postgresql.  If you are 
doing something like this, can you please tell me how you are doing this.  I 
can do a relationship with a parent child or a nested tree, but I need to do a 
DAG.

Thanks for the help,
timgerr

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 11:04 AM, Tim Gallagher <tgallag...@danati.com> wrote:
> I cannot be the only one that is having this problem, what are you using for 
> DAG (Direct Acrylic Graph)?  I need to have a mesh node edge graph and am 
> having trouble with this?  I see that Neo4j has a rest server and I can do 
> this in Java but I want to do it in PHP with a MYSQL or postgresql.  If you 
> are doing something like this, can you please tell me how you are doing this. 
>  I can do a relationship with a parent child or a nested tree, but I need to 
> do a DAG.
>
> Thanks for the help,
> timgerr
>

A basic approach would be to use two tables - one to store the nodes
and second table to store the edges between the nodes. As far as
traversing the graph, the best approach I have seen expands this a bit
to store the full transitive closure of the graph, rather than just
the direct edges:

http://www.codeproject.com/KB/database/Modeling_DAGs_on_SQL_DBs.aspx

It is written for SQL Server, but the idea works OK (and I
successfully tested it once) in MySQL. (I imagine the same would be
true for PostgreSQL.)

The idea is to store the transitive closure (every possible path) of
the entire graph. For instance, if you have a basic graph

A -> B -> C -> D

it stores these paths:

A -> B
B -> C
C -> D
A -> C
B -> D
A -> D

The obvious downside is that edge table can get incredibly large
depending on the nature of the graph you are modeling. (The article
provides much more detail.) I did, however, import a good chunk of an
Active Directory tree (just users and groups, not the full list of
attributes) into this pattern just to test the concept, and I found
that in that case the size of the transitive closure table did not get
out of hand.


Andrew

--- End Message ---
--- Begin Message ---
Thank you for the informaiton.  I did see that code but it looks like it is 
formatted for MSSQL and was unable to get it to work for Mysql.

Tim 

________________________________________
From: Andrew Ballard [aball...@gmail.com]
Sent: Wednesday, July 21, 2010 11:40 AM
To: Tim Gallagher
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] Question about SQL and Graph nodel trees

On Wed, Jul 21, 2010 at 11:04 AM, Tim Gallagher <tgallag...@danati.com> wrote:
> I cannot be the only one that is having this problem, what are you using for 
> DAG (Direct Acrylic Graph)?  I need to have a mesh node edge graph and am 
> having trouble with this?  I see that Neo4j has a rest server and I can do 
> this in Java but I want to do it in PHP with a MYSQL or postgresql.  If you 
> are doing something like this, can you please tell me how you are doing this. 
>  I can do a relationship with a parent child or a nested tree, but I need to 
> do a DAG.
>
> Thanks for the help,
> timgerr
>

A basic approach would be to use two tables - one to store the nodes
and second table to store the edges between the nodes. As far as
traversing the graph, the best approach I have seen expands this a bit
to store the full transitive closure of the graph, rather than just
the direct edges:

http://www.codeproject.com/KB/database/Modeling_DAGs_on_SQL_DBs.aspx

It is written for SQL Server, but the idea works OK (and I
successfully tested it once) in MySQL. (I imagine the same would be
true for PostgreSQL.)

The idea is to store the transitive closure (every possible path) of
the entire graph. For instance, if you have a basic graph

A -> B -> C -> D

it stores these paths:

A -> B
B -> C
C -> D
A -> C
B -> D
A -> D

The obvious downside is that edge table can get incredibly large
depending on the nature of the graph you are modeling. (The article
provides much more detail.) I did, however, import a good chunk of an
Active Directory tree (just users and groups, not the full list of
attributes) into this pattern just to test the concept, and I found
that in that case the size of the transitive closure table did not get
out of hand.


Andrew

--- End Message ---
--- Begin Message ---
Ok, so taking the sample code that is on the page

http://us3.php.net/manual/en/language.exceptions.extending.php

Literally, just cutting and pasting the code.  When I try to

throw new Exception( 'My Message' );

PHP spits out the following fatal error:

Fatal error: Wrong parameters for Exception([string $exception [, long $code ]])

and the line number it dies on is the line in the
MyException::__construct() where it is calling the parent's
constructor.  So what's going on?  Is the documentation wrong?  Is
this a bug?  Am I doing something wrong?

I'm using PHP 5.2.9.

thnx,
Christoph

--- End Message ---
--- Begin Message ---
On Wed, 2010-07-21 at 11:10 -0400, Christoph Boget wrote:

> Ok, so taking the sample code that is on the page
> 
> http://us3.php.net/manual/en/language.exceptions.extending.php
> 
> Literally, just cutting and pasting the code.  When I try to
> 
> throw new Exception( 'My Message' );
> 
> PHP spits out the following fatal error:
> 
> Fatal error: Wrong parameters for Exception([string $exception [, long $code 
> ]])
> 
> and the line number it dies on is the line in the
> MyException::__construct() where it is calling the parent's
> constructor.  So what's going on?  Is the documentation wrong?  Is
> this a bug?  Am I doing something wrong?
> 
> I'm using PHP 5.2.9.
> 
> thnx,
> Christoph
> 


Well, it's not really a copy and paste job, as you've omitted the second
argument to the Exception method, which is what the error is complaining
about.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On 21 July 2010 16:10, Christoph Boget <jcbo...@hotmail.com> wrote:
> Ok, so taking the sample code that is on the page
>
> http://us3.php.net/manual/en/language.exceptions.extending.php
>
> Literally, just cutting and pasting the code.  When I try to
>
> throw new Exception( 'My Message' );
>
> PHP spits out the following fatal error:
>
> Fatal error: Wrong parameters for Exception([string $exception [, long $code 
> ]])
>
> and the line number it dies on is the line in the
> MyException::__construct() where it is calling the parent's
> constructor.  So what's going on?  Is the documentation wrong?  Is
> this a bug?  Am I doing something wrong?
>
> I'm using PHP 5.2.9.
>
> thnx,
> Christoph
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

As of V5.3.0, exceptions can be nested [1].

The example code will generate the following errors.

V5.0.x : Fatal error: Argument 3 must not be null
V5.1.0 - V5.1.1 : Fatal error: Wrong parameter count for
exception([string $exception [, long $code ]])
V5.1.1 - V5.2.x : Fatal error: Wrong parameters for Exception([string
$exception [, long $code ]])

The nesting is controlled by the 3rd parameter to the constructor.
Removing this will allow the code to work on your version.

<?php
class MyException extends Exception
{
    // Redefine the exception so message isn't optional
    public function __construct($message, $code = 0) {
        // some code

        // make sure everything is assigned properly
        parent::__construct($message, $code);
    }

    // custom string representation of object
    public function __toString() {
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
    }

    public function customFunction() {
        echo "A custom function for this type of exception\n";
    }
}

?>


Regards,

Richard Quadling.

[1] http://us3.php.net/manual/en/migration53.new-features.php

--- End Message ---
--- Begin Message ---
On 21 July 2010 16:14, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:
> On Wed, 2010-07-21 at 11:10 -0400, Christoph Boget wrote:
>
>> Ok, so taking the sample code that is on the page
>>
>> http://us3.php.net/manual/en/language.exceptions.extending.php
>>
>> Literally, just cutting and pasting the code.  When I try to
>>
>> throw new Exception( 'My Message' );
>>
>> PHP spits out the following fatal error:
>>
>> Fatal error: Wrong parameters for Exception([string $exception [, long $code 
>> ]])
>>
>> and the line number it dies on is the line in the
>> MyException::__construct() where it is calling the parent's
>> constructor.  So what's going on?  Is the documentation wrong?  Is
>> this a bug?  Am I doing something wrong?
>>
>> I'm using PHP 5.2.9.
>>
>> thnx,
>> Christoph
>>
>
>
> Well, it's not really a copy and paste job, as you've omitted the second
> argument to the Exception method, which is what the error is complaining
> about.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

Ashley, the second argument is optional, hence the [] around the [, long $code].

The issue is one of BC as I've described above. Removing the BC allows
the code to work as documented.

--- End Message ---
--- Begin Message ---
On 21 July 2010 16:30, Christoph Boget <jcbo...@hotmail.com> wrote:
>> [1] http://us3.php.net/manual/en/migration53.new-features.php
>
> Thanks for this.  And thanks for your explanation.  I think it would have
> been nice for there to have been some mention anywhere near/around example
> #2 on http://us3.php.net/manual/en/language.exceptions.extending.php to have
> mentioned it would only work on 5.3+.  :/
> Again, thanks.
> thnx,
> Christoph

http://svn.php.net/viewvc?view=revision&revision=301446

--- End Message ---
--- Begin Message ---
Hi,

 

I'm using PHP to output an XML file for use with Google Maps - the XML file
containing data for each location.

 

$dom = new DOMDocument("1.0");

 

$locations = $dom->createElement("locations");

$dom->appendChild($locations);  //  append $node as a child of $dom  (I
think???)

 

for($i=1;$i<=$number_of_locations;$i++) {

                $row = mysql_fetch_assoc($query);

 

                $location = $dom->createElement("location");
//  Create a new element "location"

                $locations->appendChild($location);                       //
Append "location" as a child of "locations" (the document shell)

                

                $name =
$dom->createElement("name",htmlentities($row['location_name']));

                $location->appendChild($name);

 

.. And so on

 

Ultimately, I want to have an XML output that looks like (which I'm ALMOST
getting, but.):

 

<?xml version="1.0" ?> 

<locations>

      <location>

        <name>Some company name</name> 

        <street>12345 Some Street</street> 

        <street2>Some Apt Number</street2> 

        <city>Some City</city> 

        <state>CA</state> 

        <zip>90210</zip> 

      </location>

</locations>

 

 

Then I'm using JS to feed each location into Google Maps, creating a sidebar
entry and marker for each.

 

Problem:

If street2 (or any other field) has no value, PHP is outputting the XML node
as <street2 />, which is producing a JS error when I try to call:

<script type="text/javascript">..

street2 = x[i].getElementsByTagName("street2")[0].childNodes[0].nodeValue;

                ...</script>   (Because the requested node has no
.nodeValue, I'm assuming???)

 

Question:

Can I tell PHP to output the XML node as <street2></street2> instead of
<street2 /> so that JS sees that the object has a value, but the value is ""
(blank)?

 

Many thanks in advance for any help.

 

Ben


--- End Message ---
--- Begin Message ---
Take for example:
INSERT INTO table ( field ) VALUES ('{$variable}' )

Why the curly brackets? Where in the fine manual is this addressed? I
started from [1] but did not find the relevant info.

[1] http://il2.php.net/manual/en/book.mysql.php

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 14:59, Dotan Cohen <dotanco...@gmail.com> wrote:
> Take for example:
> INSERT INTO table ( field ) VALUES ('{$variable}' )
>
> Why the curly brackets? Where in the fine manual is this addressed? I
> started from [1] but did not find the relevant info.
>
> [1] http://il2.php.net/manual/en/book.mysql.php

    That's just basic variable parsing on the PHP side, it's not
MySQL-specific.  Check out the "variable parsing" heading at
http://php.net/string .

-- 
</Daniel P. Brown>
UNADVERTISED DEDICATED SERVER SPECIALS
SAME-DAY SETUP
Just ask me what we're offering today!
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 22:07, Daniel Brown <danbr...@php.net> wrote:
>    That's just basic variable parsing on the PHP side, it's not
> MySQL-specific.  Check out the "variable parsing" heading at
> http://php.net/string .
>

Thanks, Daniel. It seems unnecessary, then, as the quote character is
not a valid character in a variable name.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 1:17 PM, Dotan Cohen <dotanco...@gmail.com> wrote:

> On Wed, Jul 21, 2010 at 22:07, Daniel Brown <danbr...@php.net> wrote:
> >    That's just basic variable parsing on the PHP side, it's not
> > MySQL-specific.  Check out the "variable parsing" heading at
> > http://php.net/string .
> >
>
> Thanks, Daniel. It seems unnecessary, then, as the quote character is
> not a valid character in a variable name.


the single quote is not part of the variable name in the example you posted
and further more the curly braces won't be evaluated as part of a variable
name unless the string expression is wrapped in double quotes (which probly
also evaluates in heredocs & nowdocs).  in this case, i would say you are
right, the curly braces seem gratuitous; again as dan suggested, read the
docs for clarification ...

http://us.php.net/manual/en/language.types.string.php#language.types.string.parsing

-nathan

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 22:27, Nathan Nobbe <quickshif...@gmail.com> wrote:
> the single quote is not part of the variable name in the example you posted
> and further more the curly braces won't be evaluated as part of a variable
> name unless the string expression is wrapped in double quotes (which probly
> also evaluates in heredocs & nowdocs).  in this case, i would say you are
> right, the curly braces seem gratuitous; again as dan suggested, read the
> docs for clarification ...
> http://us.php.net/manual/en/language.types.string.php#language.types.string.parsing

Thanks, Nathan, I _just_finished_ reading that page!



-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 1:32 PM, Daniel Brown <danbr...@php.net> wrote:

> On Wed, Jul 21, 2010 at 15:27, Nathan Nobbe <quickshif...@gmail.com>
> wrote:
> >
> [snip!]
> > name unless the string expression is wrapped in double quotes (which
> probly
> > also evaluates in heredocs & nowdocs).
> [snip!]
>
>    Close.  HEREDOC, yes.  NOWDOC, no.  There's zero parsing done on
> NOWDOC strings.


word.

-nathan

--- End Message ---
--- Begin Message ---
On Wed, Jul 21, 2010 at 15:27, Nathan Nobbe <quickshif...@gmail.com> wrote:
>
[snip!]
> name unless the string expression is wrapped in double quotes (which probly
> also evaluates in heredocs & nowdocs).
[snip!]

    Close.  HEREDOC, yes.  NOWDOC, no.  There's zero parsing done on
NOWDOC strings.

-- 
</Daniel P. Brown>
UNADVERTISED DEDICATED SERVER SPECIALS
SAME-DAY SETUP
Just ask me what we're offering today!
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/

--- End Message ---
--- Begin Message ---
Dear Bob McConnell,
       Thank you for your reply.
       I really post the same message eight times because of the first e-mail 
authentication.please remove the extra e-mail in your free time.
       There are two servers ,the first installation of 32-bit linux(RHEL),the 
second installlation 64-bit linux(CENTOS).
       PHP version on 32-bit linux(RHEL):5.2.7
       PHP version on 64-bit linux(CENTOS):5.2.13
      I found this problem,because the software transplantation.In the 64-bit 
systems,the array seems to always have limited capacity. I'm not sure that is 
php version problem or need other configurations.
      Please give further guidance, thank you very much!


best wishs,

Yang Fei
2010-7-22








发件人: Bob McConnell 
发送时间: 2010-07-21  20:06:36 
收件人: fyang; php-gene...@lists.php.net 
抄送: 
主题: RE: [PHP] php array in different OS 
 
From: fyang

>     I have a simple test code in different OS ,but it give me a
different 
> result.
>     the code as follows:
>         <?php
>         $n= 50000;
>         for($i=0;$i <$n;$i++)
>         {
>              $data[]=array("",$i,$i/1000);
>              echo $i,"  ",$data[$i][1]," <br >";
>         }
>         echo "count:",count($data);
>        ? >
>    OS1:  Red Hat Enterprise Linux Server release 5.1
>          Linux 2.6.18-53.el5xen i686 i686 i386 GNU/Linux
>    test result:  the result is correct,it can display 50000 data and 
> count:50000.
> 
>    OS2: CentOS release 5.4
>         Linux 2.6.18-164.el5 x86_64 x86_64 x86_64 GNU/Linux
>    test result: the result is wrong,it can only display 31148 data and
it 
> can not display count value.
>    I'm not sure the result relate to array capacity in different OS.
>    Please give me some tips,thanks in advance.

Did you really have to post the same message eight times?

CentOS is Red Hat minus the proprietary elements, so you actually have
two releases of the same OS here. The bigger question is what version of
PHP are you running on each of them and how are they configured?

Bob McConnell

--- End Message ---

Reply via email to