GithubHelp home page GithubHelp logo

php2go's Introduction

Build Status Go Report Card GoDoc GitHub contributors license GitHub code size in bytes

这是一个用Go语言开发的辅助库,尤其适用于熟悉PHP内置函数的开发者,将会实现PHP内置函数。

下载安装

go get -u github.com/awesee/php2go/php

关于命名

PHP下划线命名转为Go大驼峰命名。

Example:

package main

import (
    "github.com/awesee/php2go/php"
)

func main() {

    php.Echo("Hello ", "world!\n")

}

More

项目进度

TODO List

贡献代码

贡献指南

Contributors

Your contributions are always welcome!

LICENSE

Released under MIT LICENSE

php2go's People

Contributors

awesee avatar fengdingbo avatar guanguans avatar mostend avatar openset avatar qiuker521 avatar suhanyujie avatar sunnyregion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

php2go's Issues

注意事项

本项目仅供学习使用,不要在生产环境中使用!!!

本项目的目的不是给用户提供一个和php行为一致的方法库,而是帮助php开发者快速熟悉Go语言中相对应的功能。php是弱类型语言,Go是强类型语言,使用Go时尽量以Go的编程规范和思维来写代码。

对数据结构和算法感兴趣的同学,可以关注此项目:力扣

编译时报错

..\github.com\openset\php2go\php\directory.go:27:22: cannot use fd (type int) as type syscall.Handle in argument to syscall.Close

以下函数错误

github.com/openset/php2go/php

....\pkg\mod\github.com\openset\[email protected]\php\directory.go:27:22: cannot use fd (type int) as type syscall.Handle in argument to syscall.Close

Compilation finished with exit code 2

// Closedir - Close directory's handle
func Closedir(fd int) (err error) {

	return syscall.Close(fd)
}

Hex conversion

I think the three functions are wrong

//Decimal to binary
func Decbin(x int64) string {

	return strconv.FormatInt(x, 2)
}

//Decimal to hexadecimal
func Dechex(x int64) string {

	return strconv.FormatInt(x, 16)
}

//Decimal to octal
func Decoct(x int64) string {

	return strconv.FormatInt(x, 8)
}

In PHP, the parameter can be a number or a string, if it is other type, the return value is 0

ArrayColumn这个方法貌似无法满足array_column的返回值吧

大神你好,我是新手,不是很懂,这里跟您请教一下ArrayColumn这个问题

map[string]map[string]interface{}

相同key对应地址的值不是被覆盖掉了吗?
所以这样最多只能取到多维map中某个key对应的一维map
而无法像PHP一样做到多维数组中的所有相同key对应的那个val

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.