php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71022 the translation of usage of Spaceship operator is wrong.
Submitted: 2015-12-04 01:52 UTC Modified: 2015-12-28 03:44 UTC
From: seekerliu at vip dot qq dot com Assigned: jhdxr (profile)
Status: Closed Package: Translation problem
PHP Version: 7.0.0 OS: windows10
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: seekerliu at vip dot qq dot com
New email:
PHP Version: OS:

 

 [2015-12-04 01:52 UTC] seekerliu at vip dot qq dot com
Description:
------------
---
From manual page: http://www.php.net/migration70.new-features
---
此句中对“太空船操作符”的作用翻译为:
当$a大于、等于或小于$b时它分别返回-1、0或1。(incorrect)
实际应为:
当$a小于、等于或大于$b时它分别返回-1、0或1。(correct)

另附英文原版:
It returns -1, 0 or 1 when $a is respectively less than, equal to, or greater than $b。

Test script:
---------------
<?php
// Integers
echo 1 <=> 1; // 0
echo 1 <=> 2; // -1
echo 2 <=> 1; // 1

// Floats
echo 1.5 <=> 1.5; // 0
echo 1.5 <=> 2.5; // -1
echo 2.5 <=> 1.5; // 1
 
// Strings
echo "a" <=> "a"; // 0
echo "a" <=> "b"; // -1
echo "b" <=> "a"; // 1
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-22 08:00 UTC] jhdxr@php.net
Automatic comment from SVN on behalf of jhdxr
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=338339
Log: Fixed bug #71022 	the translation of usage of Spaceship operator is wrong.
 [2015-12-22 08:02 UTC] jhdxr@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: jhdxr
 [2015-12-22 08:02 UTC] jhdxr@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2015-12-23 01:19 UTC] seekerliu at vip dot qq dot com
-Status: Closed +Status: Assigned
 [2015-12-23 01:19 UTC] seekerliu at vip dot qq dot com
in the new documentation's XML sources also have a mistake:
"太空船操作符用于比较两个表达式。当<varname>$a</varname>小于、等于或大于<varname>$b</varname>时它分别返回1、0或-1。"

the right version is:
"太空船操作符用于比较两个表达式。当<varname>$a</varname>小于、等于或大于<varname>$b</varname>时它分别返回-1、0或1。"

对应关系:
当$a 小于 $b, 返回 -1
当$a 等于 $b, 返回 0
当$a 大于 $b, 返回 1
 [2015-12-23 08:04 UTC] jhdxr@php.net
Yep. It's my fault. Someone else had corrected the sentence to "当$a大于、等于或小于$b时它分别返回1、0或-1", however, he/she did not commit to svn. And after my commit (r338339), I found this problem and fix it immediately, and now the doc online is correct. Thanks for your report.
 [2015-12-28 03:44 UTC] jhdxr@php.net
-Status: Assigned +Status: Closed
 [2020-12-30 10:47 UTC] nikic@php.net
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=doc/zh.git;a=commit;h=c7bee45bdb0fd3b07b978ac5b1ea0d8e4d81e246
Log: Fixed bug #71022 	the translation of usage of Spaceship operator is wrong.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC