php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76122 [ZH] some example code is wrong of "String" in Chinese Doc
Submitted: 2018-03-21 00:07 UTC Modified: 2018-09-09 00:30 UTC
From: hongstarw at 126 dot com Assigned: carusogabriel (profile)
Status: Closed Package: Translation problem
PHP Version: 7.2.4RC1 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hongstarw at 126 dot com
New email:
PHP Version: OS:

 

 [2018-03-21 00:07 UTC] hongstarw at 126 dot com
Description:
------------
some example code is wrong of  "String" in  Chinese Doc 

link:
http://php.net/manual/zh/language.types.string.php


也可以在字符串中用此语法通过变量来调用类的属性。

<?php
class foo {
    var $bar = 'I am bar.';
}

$foo = new foo();
$bar = 'bar';
$baz = array('foo', 'bar', 'baz', 'quux');
echo "{$foo->$bar}\n";
echo "{$foo->$baz[1]}\n";
?>
以上例程会输出:


I am bar.
I am bar.


The line before "?>" should be "echo "{$foo->{$baz[1]}}\n";"
{} is missing in Chinese document.There will be an error.
Please check it.

Expected result:
----------------
"echo "{$foo->$baz[1]}\n" " should be "echo "{$foo->{$baz[1]}}\n";"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-21 09:32 UTC] cmb@php.net
-Summary: some example code is wrong of "String" in Chinese Doc +Summary: [ZH] some example code is wrong of "String" in Chinese Doc -Package: Documentation problem +Package: Translation problem
 [2018-09-09 00:26 UTC] carusogabriel@php.net
Automatic comment from SVN on behalf of carusogabriel
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=345613
Log: Fix Bug #76122

There were missing {} is one of the examples, resulting in an error in the ZH translation.
 [2018-09-09 00:30 UTC] carusogabriel@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: carusogabriel
 [2018-09-09 00:30 UTC] carusogabriel@php.net
Thank you for your bug report.

We've fixed it and you should be able to see the reflected changes in a couple of days in php.net.
 [2020-12-30 10:47 UTC] nikic@php.net
Automatic comment on behalf of carusogabriel
Revision: http://git.php.net/?p=doc/zh.git;a=commit;h=542af79da1ebd617df70e5b6de53dcbc73626f6d
Log: Fix Bug #76122
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 06:01:29 2024 UTC